Skip to content

Commit

Permalink
added test refs #14438, #144441, #21
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Feb 29, 2024
1 parent 1ce6d59 commit ffbf223
Show file tree
Hide file tree
Showing 8 changed files with 147 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/first_teleport_custom_duration/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,52 @@
#!/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.insertStop(vehID, 0, "A0A1", 50)
traci.vehicle.setStopParameter(vehID, 0, "speed", "1000")
traci.vehicle.setStopParameter(vehID, 0, "jump", "30")
traci.vehicle.replaceStop(vehID, 1, "busStop_A2B2", flags=tc.STOP_BUS_STOP,
duration=30, teleport=1)
traci.simulationStep()
traci.close()
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- generated on 2024-02-29 16:44:57 by Eclipse SUMO sumo Version v1_19_0+1097-b485b475aa1
<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="51833"/>
</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="254.00">
<routeDistribution>
<route replacedOnEdge="A0A1" reason="traci:insertStop" 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 C1D1 D1D2 D2D3"/>
<route edges="A0A1 A2B2 B2B1 B1C1 C1D1 D1D2 D2D3"/>
</routeDistribution>
<stop lane="A0A1_0" startPos="49.90" endPos="50.00" duration="92233720368547758.07" speed="1000.00" jump="30.00"/>
<stop edge="A0A1" speed="1000.00" jump="0.00"/>
<stop busStop="busStop_A2B2" duration="30.00"/>
<stop busStop="busStop_B1C1" duration="60.00"/>
<stop busStop="busStop_C1D1" duration="60.00"/>
</vehicle>

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

<!-- generated on 2021-08-23 12:03:08 by Eclipse SUMO sumo Version v1_10_0+0129-6ada7b0
<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>
<processing>
<time-to-teleport.disconnected value="1"/>
<pedestrian.model value="nonInteracting"/>
</processing>
<report>
<no-step-log value="true"/>
</report>
<traci_server>
<remote-port value="40117"/>
</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="194.00">
<routeDistribution>
<route replacedOnEdge="A0A1" reason="traci:replaceStop" replacedAtTime="5.00" probability="0" edges="A0A1 A1B1 B1C1 C1D1 D1D2 D2D3"/>
<route edges="A0A1 A2B2 B2B1 B1C1 C1D1 D1D2 D2D3"/>
</routeDistribution>
<stop busStop="busStop_A2B2" duration="30.00"/>
<stop busStop="busStop_B1C1" duration="60.00"/>
<stop busStop="busStop_C1D1" duration="60.00"/>
</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 @@ -13,6 +13,9 @@ first_later
# replace first stop after the vehicle has departed
first_teleport

# set custom jump duration
first_teleport_custom_duration

# replace second stop after the vehicle has departed
second

Expand Down

0 comments on commit ffbf223

Please sign in to comment.