Skip to content

Commit

Permalink
added test refs #14789, #21
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Apr 29, 2024
1 parent 1094b66 commit 4abbb76
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 0 deletions.
Empty file.
6 changes: 6 additions & 0 deletions tests/complex/traci/vehicle/changeTarget/input_routes.rou.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/routes_file.xsd">
<vType id="car" sigma="0"/>
<trip id="v" type="car" depart="0" departSpeed="avg" from="A1B1" to="C1D1">
<stop edge="B2C2" duration="5"/>
</trip>
</routes>
1 change: 1 addition & 0 deletions tests/complex/traci/vehicle/changeTarget/options.complex
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tests/complex/traci/vehicle/changeTarget/runner.py
1 change: 1 addition & 0 deletions tests/complex/traci/vehicle/changeTarget/output.complex
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Retrying in 1 seconds
45 changes: 45 additions & 0 deletions tests/complex/traci/vehicle/changeTarget/runner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/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 Mirko Barthauer (Technische Universitaet Braunschweig)
# @date 2018-09-27

from __future__ import print_function
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",
"-r", "input_routes.rou.xml",
"--stop-output", "stopinfos.xml",
"--no-step-log",
] + sys.argv[1:])


vehID = "v"
traci.simulationStep()
traci.vehicle.changeTarget(vehID, "D1D0")
while traci.simulation.getMinExpectedNumber() > 0:
traci.simulationStep()

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

<!-- generated on 2024-04-29 09:27:38 by Eclipse SUMO sumo Version v1_19_0+1962-7cdf26f2482
<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"/>
</input>
<output>
<stop-output value="stopinfos.xml"/>
</output>
<report>
<no-step-log value="true"/>
</report>
<traci_server>
<remote-port value="49753"/>
</traci_server>
</configuration>
-->

<stops xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/stopinfo_file.xsd">
</stops>
3 changes: 3 additions & 0 deletions tests/complex/traci/vehicle/testsuite.complex
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,6 @@ getNextTLS

# get numbr of alighting persons at the next stop
alightingPersons

# check handling of stops (#14789)
changeTarget

0 comments on commit 4abbb76

Please sign in to comment.