Skip to content

Commit

Permalink
added test refs #15351, #21
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Aug 27, 2024
1 parent 69d8616 commit c3e35d6
Show file tree
Hide file tree
Showing 10 changed files with 206 additions and 0 deletions.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<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" departSpeed="max">
<route edges="SC CN"/>
</vehicle>
</routes>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tests/complex/traci/vehicle/setStop/newStop_fast/runner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Retrying in 1 seconds
speed= 14.723400000000002
53 changes: 53 additions & 0 deletions tests/complex/traci/vehicle/setStop/newStop_fast/runner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/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_net2.net.xml",
"-a", "input_additional2.add.xml",
"-r", "input_routes.rou.xml",
"--no-step-log",
#"--mesosim",
"--vehroute-output", "vehroutes.xml",
"--stop-output", "stopinfos.xml",
] + sys.argv[1:])

vehID = "ego"

traci.simulationStep()
pos = traci.vehicle.getLanePosition(vehID)
print("speed=", traci.vehicle.getSpeed(vehID))
traci.vehicle.setStop("ego", "SC", pos + 50, duration=3)

while traci.simulation.getMinExpectedNumber() > 0:
traci.simulationStep()
traci.close()
30 changes: 30 additions & 0 deletions tests/complex/traci/vehicle/setStop/newStop_fast/stopinfos.complex
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- generated on 2024-08-27 19:48:21 by Eclipse SUMO sumo Version v1_20_0+1746-69d86166f23
<sumoConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/sumoConfiguration.xsd">
<input>
<net-file value="input_net2.net.xml"/>
<route-files value="input_routes.rou.xml"/>
<additional-files value="input_additional2.add.xml"/>
</input>
<output>
<vehroute-output value="vehroutes.xml"/>
<stop-output value="stopinfos.xml"/>
</output>
<report>
<no-step-log value="true"/>
</report>
<traci_server>
<remote-port value="59503"/>
</traci_server>
</sumoConfiguration>
-->

<stops xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/stopinfo_file.xsd">
<stopinfo id="ego" type="DEFAULT_VEHTYPE" lane="SC_0" pos="55.10" parking="0" started="8.00" ended="11.00" initialPersons="0" loadedPersons="0" unloadedPersons="0" initialContainers="0" loadedContainers="0" unloadedContainers="0"/>
</stops>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- generated on 2023-06-28 08:44:29 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_net2.net.xml"/>
<route-files value="input_routes.rou.xml"/>
<additional-files value="input_additional2.add.xml"/>
</input>
<output>
<vehroute-output value="vehroutes.xml"/>
<stop-output value="stopinfos.xml"/>
</output>
<report>
<no-step-log value="true"/>
</report>
<traci_server>
<remote-port value="51407"/>
</traci_server>
<mesoscopic>
<mesosim value="true"/>
<meso-junction-control value="true"/>
</mesoscopic>
</configuration>
-->

<stops xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/stopinfo_file.xsd">
<stopinfo id="ego" type="DEFAULT_VEHTYPE" edge="SC" pos="0.00" parking="0" started="0.00" ended="14.00" initialPersons="0" loadedPersons="0" unloadedPersons="0" initialContainers="0" loadedContainers="0" unloadedContainers="0"/>
</stops>
34 changes: 34 additions & 0 deletions tests/complex/traci/vehicle/setStop/newStop_fast/vehroutes.complex
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- generated on 2024-08-27 19:48:21 by Eclipse SUMO sumo Version v1_20_0+1746-69d86166f23
<sumoConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/sumoConfiguration.xsd">
<input>
<net-file value="input_net2.net.xml"/>
<route-files value="input_routes.rou.xml"/>
<additional-files value="input_additional2.add.xml"/>
</input>
<output>
<vehroute-output value="vehroutes.xml"/>
<stop-output value="stopinfos.xml"/>
</output>
<report>
<no-step-log value="true"/>
</report>
<traci_server>
<remote-port value="59503"/>
</traci_server>
</sumoConfiguration>
-->

<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" departSpeed="14.7234" speedFactor="1.0600" arrival="24.00">
<route edges="SC CN"/>
<stop lane="SC_0" startPos="55.00" endPos="55.10" duration="3.00"/>
</vehicle>

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

<!-- generated on 2022-01-13 16:08:49 by Eclipse SUMO sumo Version v1_11_0+1063-8400cadde28
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/sumoConfiguration.xsd">
<input>
<net-file value="input_net2.net.xml"/>
<route-files value="input_routes.rou.xml"/>
<additional-files value="input_additional2.add.xml"/>
</input>
<output>
<vehroute-output value="vehroutes.xml"/>
<stop-output value="stopinfos.xml"/>
</output>
<processing>
<pedestrian.model value="nonInteracting"/>
</processing>
<report>
<no-step-log value="true"/>
</report>
<traci_server>
<remote-port value="61043"/>
</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="20.00">
<route edges="SC CN"/>
<stop lane="SC_0" startPos="39.90" endPos="40.00" duration="7.00"/>
</vehicle>

</routes>
3 changes: 3 additions & 0 deletions tests/complex/traci/vehicle/setStop/testsuite.complex
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
newInternalStop
newStop

# brakeGap must be considered
newStop_fast

# Copy of newStop
pos_0

Expand Down

0 comments on commit c3e35d6

Please sign in to comment.