Path: blob/main/tests/complex/traci/vehicle/resume/runner.py
169712 views
#!/usr/bin/env python1# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2# Copyright (C) 2008-2025 German Aerospace Center (DLR) and others.3# This program and the accompanying materials are made available under the4# terms of the Eclipse Public License 2.0 which is available at5# https://www.eclipse.org/legal/epl-2.0/6# This Source Code may also be made available under the following Secondary7# Licenses when the conditions for such availability set forth in the Eclipse8# Public License 2.0 are satisfied: GNU General Public License, version 29# or later which is available at10# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later1213# @file runner.py14# @author Laura Bieker15# @author Michael Behrisch16# @date 2014-08-28171819from __future__ import print_function20from __future__ import absolute_import21import os22import sys232425if "SUMO_HOME" in os.environ:26sys.path.append(os.path.join(os.environ["SUMO_HOME"], "tools"))27import sumolib # noqa28import traci # noqa293031def main(args):32sumo_call = [sumolib.checkBinary('sumo'), "-c", "data/hello.sumocfg",33"--netstate-dump", "rawdump.xml",34"--no-step-log",35"-v",36] + args37traci.start(sumo_call)38step = -139while True:40step += 141traci.simulationStep()42if step == 140:43traci.vehicle.resume('Stapler_00')44if step == 161:45traci.close()46break474849if __name__ == "__main__":50main(sys.argv[1:])515253