Skip to content

Commit

Permalink
added test refs #14205, #21
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Apr 12, 2024
1 parent 64526dd commit 59b2744
Show file tree
Hide file tree
Showing 13 changed files with 167 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>

<additional xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/additional_file.xsd">
<!-- rerouter notification should not impact vehicle behavior -->
<rerouter id="rr" edges="end">
<interval begin="1" end="3600">
<closingReroute id="middle" allow="authority"/>
<closingReroute id="middle2" allow="authority"/>
</interval>
</rerouter>
</additional>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tests/complex/traci/misc/rerouting/rerouter_routingMode/runner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Retrying in 1 seconds
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- generated on 2024-04-12 09:39:20 by Eclipse SUMO sumo Version v1_19_0+1795-64526dd6675
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/sumoConfiguration.xsd">
<input>
<net-file value="input_net.net.xml"/>
<route-files value="input_routes.rou.xml"/>
<additional-files value="input_additional.add.xml"/>
</input>
<output>
<vehroute-output value="vehroutes.xml"/>
</output>
<processing>
<default.speeddev value="0"/>
</processing>
<report>
<duration-log.disable value="true"/>
<no-step-log value="true"/>
</report>
<traci_server>
<remote-port value="36709"/>
</traci_server>
</configuration>
-->

<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/routes_file.xsd">
<vehicle id="ego" depart="0.00" arrival="46.00">
<routeDistribution>
<route replacedOnEdge="beg" reason="traci:rerouteTraveltime" replacedAtTime="2.00" probability="0" edges="beg middle2 end"/>
<route edges="beg middle3 end"/>
</routeDistribution>
</vehicle>

</routes>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Warning: Teleporting vehicle 'ego'; waited too long (wrong lane), lane='beg_0', time=312.00.
Warning: Vehicle 'ego' ends teleporting on edge 'end', time=321.00.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ignore_transient tests/complex/traci/misc/rerouting/rerouter_routingMode/runner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Retrying in 1 seconds
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- generated on 2024-04-12 09:40:54 by Eclipse SUMO sumo Version v1_19_0+1795-64526dd6675
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/sumoConfiguration.xsd">
<input>
<net-file value="input_net.net.xml"/>
<route-files value="input_routes.rou.xml"/>
<additional-files value="input_additional.add.xml"/>
</input>
<output>
<vehroute-output value="vehroutes.xml"/>
</output>
<processing>
<default.speeddev value="0"/>
</processing>
<report>
<duration-log.disable value="true"/>
<no-step-log value="true"/>
</report>
<traci_server>
<remote-port value="59203"/>
</traci_server>
</configuration>
-->

<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/routes_file.xsd">
<vehicle id="ego" depart="0.00" arrival="328.00">
<routeDistribution>
<route replacedOnEdge="beg" reason="traci:rerouteTraveltime" replacedAtTime="2.00" probability="0" edges="beg middle2 end"/>
<route edges="beg middle end"/>
</routeDistribution>
</vehicle>

</routes>
40 changes: 40 additions & 0 deletions tests/complex/traci/misc/rerouting/rerouter_routingMode/runner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
# Copyright (C) 2008-2024 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.eclipse.org/legal/epl-2.0/
# This Source Code may also be made available under the following Secondary
# Licenses when the conditions for such availability set forth in the Eclipse
# Public License 2.0 are satisfied: GNU General Public License, version 2
# or later which is available at
# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later

# @file runner.py
# @author Jakob Erdmann
# @date 2017-01-23


from __future__ import print_function
from __future__ import absolute_import
import os
import sys

if "SUMO_HOME" in os.environ:
sys.path.append(os.path.join(os.environ['SUMO_HOME'], 'tools'))
import traci # noqa
import sumolib # noqa

traci.start([sumolib.checkBinary('sumo'),'-c', 'sumo.sumocfg'])
traci.simulationStep()
traci.simulationStep()
for vehID in traci.vehicle.getIDList():
if "ignore_transient" in sys.argv:
traci.vehicle.setRoutingMode(vehID, traci.constants.ROUTING_MODE_IGNORE_TRANSIENT_PERMISSIONS)
traci.vehicle.rerouteTraveltime(vehID)

while traci.simulation.getMinExpectedNumber() > 0:
traci.simulationStep()
traci.close()
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/sumoConfiguration.xsd">

<input>
<net-file value="input_net.net.xml"/>
<route-files value="input_routes.rou.xml"/>
<additional-files value="input_additional.add.xml"/>
</input>

<processing>
<default.speeddev value="0"/>
</processing>

<report>
<duration-log.disable value="true"/>
<no-step-log value="true"/>
</report>

<output>
<vehroute-output value="vehroutes.xml"/>
</output>

</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copy of rerouteTraveltime_default
rerouteTraveltime_default

# ignore permission changes by rerouter
rerouteTraveltime_ignoreRerouter
3 changes: 3 additions & 0 deletions tests/complex/traci/misc/rerouting/testsuite.complex
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ rerouteParkingArea_undeparted
# tests for behavior when using setRoutingMode
routingMode

# interaction between transient permission changes (closingReroute) and routingMode
rerouter_routingMode

# rerouting person
person
findIntermodalRoute

0 comments on commit 59b2744

Please sign in to comment.