Skip to content

Commit

Permalink
added test refs #14589, #21
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Mar 25, 2024
1 parent 2c376fa commit 42fd036
Show file tree
Hide file tree
Showing 14 changed files with 329 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/complex/config.complex
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ gtfs_routes:gtfs_pt_vehicles.add.xml
gtfs_additional:gtfs_pt_stops.add.xml
vtypes:vtypes.xml
cfg:config.sumocfg
aggregated:aggregated.xml

[run_dependent_text]
output:<!--{[->]}-->
Expand Down
46 changes: 46 additions & 0 deletions tests/complex/traci/lane/setMaxSpeed2/aggregated.complex
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- generated on 2024-03-25 14:08:36 by Eclipse SUMO sumo Version v1_19_0+1525-a01a4bc4749
<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>
<tripinfo-output value="tripinfo.xml"/>
<lanedata-output value="aggregated.xml"/>
</output>
<report>
<no-step-log value="true"/>
</report>
<traci_server>
<remote-port value="55821"/>
</traci_server>
<mesoscopic>
<meso-lane-queue value="true"/>
</mesoscopic>
</configuration>
-->

<meandata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/meandata_file.xsd">
<interval begin="0.00" end="217.00" id="DEFAULT_LANEDATA">
<edge id="A0A1">
<lane id="A0A1_0" sampledSeconds="285.24" traveltime="16.32" overlapTraveltime="16.96" density="13.14" laneDensity="13.14" occupancy="6.51" waitingTime="87.00" timeLoss="157.43" speed="6.19" speedRelative="0.45" departed="20" arrived="0" entered="0" left="11" laneChangedFrom="9" laneChangedTo="0"/>
<lane id="A0A1_1" sampledSeconds="17.52" traveltime="7.59" overlapTraveltime="7.99" density="0.81" laneDensity="0.81" occupancy="0.36" waitingTime="0.00" timeLoss="0.95" speed="13.13" speedRelative="0.95" departed="0" arrived="0" entered="0" left="9" laneChangedFrom="0" laneChangedTo="9"/>
</edge>
<edge id="A1A2">
<lane id="A1A2_0" sampledSeconds="82.94" traveltime="7.89" overlapTraveltime="8.27" density="3.82" laneDensity="3.82" occupancy="1.80" waitingTime="0.00" timeLoss="6.72" speed="12.69" speedRelative="0.91" departed="0" arrived="0" entered="11" left="10" laneChangedFrom="1" laneChangedTo="0"/>
<lane id="A1A2_1" sampledSeconds="80.60" traveltime="7.70" overlapTraveltime="8.08" density="3.71" laneDensity="3.71" occupancy="1.77" waitingTime="0.00" timeLoss="5.19" speed="12.99" speedRelative="0.94" departed="0" arrived="0" entered="9" left="10" laneChangedFrom="0" laneChangedTo="1"/>
</edge>
<edge id="A2A3">
<lane id="A2A3_0" sampledSeconds="78.58" traveltime="7.57" overlapTraveltime="7.95" density="3.62" laneDensity="3.62" occupancy="1.74" waitingTime="0.00" timeLoss="3.85" speed="13.21" speedRelative="0.95" departed="0" arrived="10" entered="10" left="0" laneChangedFrom="0" laneChangedTo="0"/>
<lane id="A2A3_1" sampledSeconds="78.86" traveltime="7.53" overlapTraveltime="7.92" density="3.63" laneDensity="3.63" occupancy="1.73" waitingTime="0.00" timeLoss="3.55" speed="13.27" speedRelative="0.96" departed="0" arrived="10" entered="10" left="0" laneChangedFrom="0" laneChangedTo="0"/>
</edge>
</interval>
</meandata>
47 changes: 47 additions & 0 deletions tests/complex/traci/lane/setMaxSpeed2/aggregated.complex.meso
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- generated on 2024-03-25 14:08:42 by Eclipse SUMO sumo Version v1_19_0+1525-a01a4bc4749
<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>
<tripinfo-output value="tripinfo.xml"/>
<lanedata-output value="aggregated.xml"/>
</output>
<report>
<no-step-log value="true"/>
</report>
<traci_server>
<remote-port value="39599"/>
</traci_server>
<mesoscopic>
<mesosim value="true"/>
<meso-lane-queue value="true"/>
<meso-junction-control value="true"/>
</mesoscopic>
</configuration>
-->

<meandata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/meandata_file.xsd">
<interval begin="0.00" end="213.00" id="DEFAULT_LANEDATA">
<edge id="A0A1">
<lane id="A0A1_0" sampledSeconds="143.98" traveltime="7.20" overlapTraveltime="7.56" density="6.76" laneDensity="6.76" occupancy="3.38" waitingTime="0.00" timeLoss="0.00" speed="13.89" speedRelative="1.00" departed="0" arrived="0" entered="0" left="0" laneChangedFrom="0" laneChangedTo="0"/>
</edge>
<edge id="A1A2">
<lane id="A1A2_0" sampledSeconds="167.26" traveltime="15.21" overlapTraveltime="15.97" density="7.85" laneDensity="7.85" occupancy="3.93" waitingTime="92.80" timeLoss="92.47" speed="6.58" speedRelative="0.47" departed="0" arrived="0" entered="0" left="0" laneChangedFrom="0" laneChangedTo="0"/>
<lane id="A1A2_1" sampledSeconds="64.79" traveltime="7.20" overlapTraveltime="7.56" density="3.04" laneDensity="3.04" occupancy="1.52" waitingTime="0.00" timeLoss="0.00" speed="13.89" speedRelative="1.00" departed="0" arrived="0" entered="0" left="0" laneChangedFrom="0" laneChangedTo="0"/>
</edge>
<edge id="A2A3">
<lane id="A2A3_0" sampledSeconds="129.58" traveltime="7.20" overlapTraveltime="7.56" density="6.08" laneDensity="6.08" occupancy="3.04" waitingTime="0.00" timeLoss="0.00" speed="13.89" speedRelative="1.00" departed="0" arrived="0" entered="0" left="0" laneChangedFrom="0" laneChangedTo="0"/>
<lane id="A2A3_1" sampledSeconds="14.40" traveltime="7.20" overlapTraveltime="7.56" density="0.68" laneDensity="0.68" occupancy="0.34" waitingTime="0.00" timeLoss="0.00" speed="13.89" speedRelative="1.00" departed="0" arrived="0" entered="0" left="0" laneChangedFrom="0" laneChangedTo="0"/>
</edge>
</interval>
</meandata>
Empty file.
1 change: 1 addition & 0 deletions tests/complex/traci/lane/setMaxSpeed2/errors.complex.meso
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.
69 changes: 69 additions & 0 deletions tests/complex/traci/lane/setMaxSpeed2/input_net4.net.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- generated on 2024-03-25 14:04:49 by Eclipse SUMO netedit Version v1_19_0+1525-a01a4bc4749
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/neteditConfiguration.xsd">
<input>
<sumo-net-file value="input_net4.net.xml"/>
</input>
<output>
<output-file value="input_net4.net.xml"/>
</output>
<processing>
<geometry.min-radius.fix.railways value="false"/>
<geometry.max-grade.fix value="false"/>
<offset.disable-normalization value="true"/>
<lefthand value="0"/>
</processing>
<junctions>
<no-internal-links value="true"/>
<no-turnarounds value="true"/>
<junctions.corner-detail value="0"/>
<junctions.limit-turn-speed value="-1.00"/>
<rectangular-lane-cut value="0"/>
</junctions>
<pedestrian>
<walkingareas value="0"/>
</pedestrian>
</configuration>
-->

<net version="1.20" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/net_file.xsd">

<location netOffset="0.00,0.00" convBoundary="0.00,0.00,0.00,300.00" origBoundary="0.00,0.00,300.00,300.00" projParameter="!"/>

<edge id="A0A1" from="A0" to="A1" priority="-1">
<lane id="A0A1_0" index="0" speed="13.89" length="100.00" shape="4.80,0.00 4.80,100.00"/>
<lane id="A0A1_1" index="1" speed="13.89" length="100.00" shape="1.60,0.00 1.60,100.00"/>
</edge>
<edge id="A1A2" from="A1" to="A2" priority="-1">
<lane id="A1A2_0" index="0" speed="13.89" length="100.00" shape="4.80,100.00 4.80,200.00"/>
<lane id="A1A2_1" index="1" speed="13.89" length="100.00" shape="1.60,100.00 1.60,200.00"/>
</edge>
<edge id="A2A3" from="A2" to="A3" priority="-1">
<lane id="A2A3_0" index="0" speed="13.89" length="100.00" shape="4.80,200.00 4.80,300.00"/>
<lane id="A2A3_1" index="1" speed="13.89" length="100.00" shape="1.60,200.00 1.60,300.00"/>
</edge>

<junction id="A0" type="dead_end" x="0.00" y="0.00" incLanes="" intLanes="" shape="0.00,0.00 6.40,0.00"/>
<junction id="A1" type="priority" x="0.00" y="100.00" incLanes="A0A1_0 A0A1_1" intLanes="" shape="0.00,100.00 6.40,100.00 0.00,100.00">
<request index="0" response="00" foes="00"/>
<request index="1" response="00" foes="00"/>
</junction>
<junction id="A2" type="priority" x="0.00" y="200.00" incLanes="A1A2_0 A1A2_1" intLanes="" shape="0.00,200.00 6.40,200.00 0.00,200.00">
<request index="0" response="00" foes="00"/>
<request index="1" response="00" foes="00"/>
</junction>
<junction id="A3" type="dead_end" x="0.00" y="300.00" incLanes="A2A3_0 A2A3_1" intLanes="" shape="6.40,300.00 0.00,300.00"/>

<connection from="A0A1" to="A1A2" fromLane="0" toLane="0" dir="s" state="M"/>
<connection from="A0A1" to="A1A2" fromLane="1" toLane="1" dir="s" state="M"/>
<connection from="A1A2" to="A2A3" fromLane="0" toLane="0" dir="s" state="M"/>
<connection from="A1A2" to="A2A3" fromLane="1" toLane="1" dir="s" state="M"/>

</net>
6 changes: 6 additions & 0 deletions tests/complex/traci/lane/setMaxSpeed2/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="DEFAULT_VEHTYPE" speedDev="0"/>
<flow id="v" begin="0" number="20" period="10">
<route edges="A0A1 A1A2 A2A3"/>
</flow>
</routes>
1 change: 1 addition & 0 deletions tests/complex/traci/lane/setMaxSpeed2/options.complex
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tests/complex/traci/lane/setMaxSpeed2/runner.py
1 change: 1 addition & 0 deletions tests/complex/traci/lane/setMaxSpeed2/output.complex
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Retrying in 1 seconds
1 change: 1 addition & 0 deletions tests/complex/traci/lane/setMaxSpeed2/output.complex.meso
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Retrying in 1 seconds
47 changes: 47 additions & 0 deletions tests/complex/traci/lane/setMaxSpeed2/runner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/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 Michael Behrisch
# @author Daniel Krajzewicz
# @date 2011-03-04


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

traci.start([sumolib.checkBinary('sumo'),
"--no-step-log",
"-n", "input_net4.net.xml",
'-r', 'input_routes.rou.xml',
'--meso-lane-queue',
'--lanedata-output', 'aggregated.xml',
'--tripinfo-output', 'tripinfo.xml'
] + sys.argv[1:])

while traci.simulation.getMinExpectedNumber() > 0:
traci.simulationStep()
if traci.simulation.getTime() == 50:
traci.lane.setMaxSpeed("A1A2_0", 0)
elif traci.simulation.getTime() == 150:
traci.lane.setMaxSpeed("A1A2_0", 13.89)

traci.close()

0 comments on commit 42fd036

Please sign in to comment.