Skip to content

Commit

Permalink
adding test refs #21
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Mar 16, 2024
1 parent 86a943e commit 9aa3c9f
Show file tree
Hide file tree
Showing 8 changed files with 134 additions and 0 deletions.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Warning: Network contains internal links which are ignored. Vehicles will 'jump' across junctions and thus underestimate route lengths and travel times.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tests/complex/traci/vehicle/replaceStop/remove_teleport_once_custom2/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,50 @@
#!/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
import traci.constants as tc # noqa


sumoBinary = sumolib.checkBinary('sumo')
traci.start([sumoBinary,
"-n", "input_net4.net.xml",
"-a", "input_additional4.add.xml",
"-r", "input_routes.rou.xml",
"--no-step-log",
"--vehroute-output", "vehroutes.xml",
] + sys.argv[1:])

vehID = "ego"

while traci.simulation.getMinExpectedNumber() > 0:
if traci.simulation.getTime() == 5:
traci.vehicle.setStopParameter(vehID, 0, "jump", "0")
traci.vehicle.replaceStop(vehID, 2, "", teleport=0)
traci.vehicle.replaceStop(vehID, 1, "", teleport=1)
traci.simulationStep()
traci.close()
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- generated on 2024-03-16 09:01:31 by Eclipse SUMO sumo Version v1_19_0+1341-86a943e1ae7
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/sumoConfiguration.xsd">
<input>
<net-file value="input_net4.net.xml"/>
<route-files value="input_routes.rou.xml"/>
<additional-files value="input_additional4.add.xml"/>
</input>
<output>
<vehroute-output value="vehroutes.xml"/>
</output>
<report>
<no-step-log value="true"/>
</report>
<traci_server>
<remote-port value="55631"/>
</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="83.00">
<routeDistribution>
<route replacedOnEdge="A0A1" reason="traci:replaceStop" replacedAtTime="5.00" probability="0" edges="A0A1 A1B1 B1C1 C1D1 D1D2 D2D3"/>
<route edges="A0A1 A1B1 D2D3"/>
</routeDistribution>
<stop busStop="busStop_A1B1" duration="60.00" jump="0.00"/>
</vehicle>

</routes>
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- generated on 2023-06-28 08:44:33 by Eclipse SUMO sumo Version v1_17_0+1317-06f42fb
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/sumoConfiguration.xsd">
<input>
<net-file value="input_net4.net.xml"/>
<route-files value="input_routes.rou.xml"/>
<additional-files value="input_additional4.add.xml"/>
</input>
<output>
<vehroute-output value="vehroutes.xml"/>
</output>
<report>
<no-step-log value="true"/>
</report>
<traci_server>
<remote-port value="57617"/>
</traci_server>
<mesoscopic>
<mesosim value="true"/>
<meso-junction-control value="true"/>
</mesoscopic>
</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="13.00">
<routeDistribution>
<route replacedOnEdge="A0A1" reason="traci:replaceStop" replacedAtTime="5.00" probability="0" edges="A0A1 A1B1 B1C1 C1D1 D1D2 D2D3"/>
<route replacedOnEdge="A0A1" reason="traci:replaceStop" replacedAtTime="5.00" probability="0" edges="A0A1 A1B1 B1C1 D2D3"/>
<route replacedOnEdge="A0A1" reason="traci:replaceStop" replacedAtTime="5.00" probability="0" edges="A0A1 A1B1 D2D3"/>
<route edges="A0A1 D2D3"/>
</routeDistribution>
</vehicle>

</routes>
3 changes: 3 additions & 0 deletions tests/complex/traci/vehicle/replaceStop/testsuite.complex
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ remove_teleport_once
# replace all stops with "" after the vehicle has departed and teleport to destination
remove_teleport_once_custom

# replace all stops with "" after the vehicle has departed and teleport to destination
remove_teleport_once_custom2

# replace second stop with "" after the vehicle has departed before the vehicle has departed
second_remove_init

Expand Down

0 comments on commit 9aa3c9f

Please sign in to comment.