Path: blob/main/tests/complex/tutorial/city_mobil/runner.py
169685 views
#!/usr/bin/env python1# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2# Copyright (C) 2011-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 Michael Behrisch15# @author Daniel Krajzewicz16# @date 2011-10-281718from __future__ import absolute_import19from __future__ import print_function2021import os22import sys23import subprocess24sys.path.append(os.path.join(os.environ["SUMO_HOME"], "tools"))25import sumolib # noqa2627os.chdir('data')28if "taxi" in sys.argv:29subprocess.call([sys.executable, "createNetTaxi.py"])30if "cyber" in sys.argv:31subprocess.call([sumolib.checkBinary("sumo"), "park15_cyber.sumocfg"])32else:33subprocess.call([sumolib.checkBinary("sumo"), "park15.sumocfg"])34else:35subprocess.call([sys.executable, "createNet.py"])36options = ["-t"]37if "cyber" in sys.argv:38options.append("-c")39if "agent" in sys.argv:40subprocess.call([sys.executable, "agentManager.py"] + options)41else:42subprocess.call([sys.executable, "simpleManager.py"] + options)434445