Skip to content

Commit

Permalink
added test refs #16147, #21
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Feb 10, 2025
1 parent 5b8cd77 commit 3ecd010
Show file tree
Hide file tree
Showing 6 changed files with 55 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">
<vType id="car" sigma="0"/>
<route id="r1" edges="1fi 1si"/>
<vehicle id="v0" type="car" depart="0" route="r1" departSpeed="max" speedFactor="1"/>
</routes>
1 change: 1 addition & 0 deletions tests/complex/traci/vehicle/setLcContRight/options.complex
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tests/complex/traci/vehicle/setLcContRight/runner.py
3 changes: 3 additions & 0 deletions tests/complex/traci/vehicle/setLcContRight/output.complex
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Retrying in 1 seconds
1.0 1fi_0
23.0 1si_0
45 changes: 45 additions & 0 deletions tests/complex/traci/vehicle/setLcContRight/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-2025 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 Matthias Schwamborn
# @date 2022-03-01

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

sumoBinary = sumolib.checkBinary('sumo')
traci.start([sumoBinary,
"-n", "input_net.net.xml",
"-r", "input_routes.rou.xml",
"--no-step-log",
] + sys.argv[1:])

vehID = "v0"
traci.vehicle.setParameter(vehID, "laneChangeModel.lcContRight", "0")
laneID = ""
while traci.simulation.getMinExpectedNumber() > 0:
if traci.vehicle.getLaneID(vehID) != laneID:
laneID = traci.vehicle.getLaneID(vehID)
print(traci.simulation.getTime(), laneID)
traci.simulationStep()

traci.close()
1 change: 1 addition & 0 deletions tests/complex/traci/vehicle/testsuite.complex
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ setEmissionClass

# test speed response curve on setting speedFactor
setSpeedFactor_IDM
setLcContRight
getFollower
getLeader

Expand Down

0 comments on commit 3ecd010

Please sign in to comment.