Skip to content

Commit

Permalink
added test refs #14459,
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Mar 4, 2024
1 parent 1ef513b commit b381277
Show file tree
Hide file tree
Showing 7 changed files with 126 additions and 0 deletions.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tests/complex/traci/vehicle/insertStop/first_init_setSpeed/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,49 @@
#!/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",
"--no-step-log",
"--stop-output", "stops.xml",
] + sys.argv[1:])

vehID = "ego"

traci.route.add("r0", ["A1B1", "C1D1"])
traci.vehicle.add(vehID, "r0")
traci.vehicle.insertStop(vehID, 0, "busStop_B1C1", flags=tc.STOP_BUS_STOP, duration=30)
traci.vehicle.setSpeed(vehID, 30)
while traci.simulation.getMinExpectedNumber() > 0:
traci.simulationStep()
traci.close()
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- generated on 2024-03-04 19:58:22 by Eclipse SUMO sumo Version v1_19_0+1148-0264d8f2cbd
<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"/>
<additional-files value="input_additional4.add.xml"/>
</input>
<output>
<stop-output value="stops.xml"/>
</output>
<report>
<no-step-log value="true"/>
</report>
<traci_server>
<remote-port value="55683"/>
</traci_server>
</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" lane="B1C1_0" pos="90.60" parking="0" started="17.00" ended="47.00" initialPersons="0" loadedPersons="0" unloadedPersons="0" initialContainers="0" loadedContainers="0" unloadedContainers="0" busStop="busStop_B1C1"/>
</stops>
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- generated on 2023-06-28 08:44:38 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="32879"/>
</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="272.00">
<routeDistribution>
<route replacedOnEdge="" reason="device.rerouting" replacedAtTime="0.00" probability="0" edges="A0A1 A1A2 A2B2 B2A2 A2A1 A1B1 B1C1 C1D1 D2D3"/>
<route edges="A0A1 A1A2 A2B2 B2A2 A2A1 A1B1 B1C1 C1D1 D1D2 D2D3"/>
</routeDistribution>
<stop busStop="busStop_A2B2" duration="30.00"/>
<stop busStop="busStop_A1B1" duration="60.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/insertStop/testsuite.complex
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ default
# replace first stop before the vehicle has departed
first_init

# test interaction of stopping and setSpeed
first_init_setSpeed

# replace first stop after the vehicle has departed
first

Expand Down

0 comments on commit b381277

Please sign in to comment.