sumolib.output.convert.ipg
This module includes functions for converting SUMO's fcd-output into data files read by IPG traces.
1# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo 2# Copyright (C) 2013-2026 German Aerospace Center (DLR) and others. 3# This program and the accompanying materials are made available under the 4# terms of the Eclipse Public License 2.0 which is available at 5# https://www.eclipse.org/legal/epl-2.0/ 6# This Source Code may also be made available under the following Secondary 7# Licenses when the conditions for such availability set forth in the Eclipse 8# Public License 2.0 are satisfied: GNU General Public License, version 2 9# or later which is available at 10# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html 11# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later 12 13# @file ipg.py 14# @author Laura Bieker-Walz 15# @date 2020-10-02 16 17""" 18This module includes functions for converting SUMO's fcd-output into 19data files read by IPG traces. 20""" 21from __future__ import print_function 22from __future__ import absolute_import 23 24 25def fcd2ipg(inpFCD, outSTRM, further): 26 print('# Time tx ty tz rx ry rz', file=outSTRM) 27 for timestep in inpFCD: 28 if timestep.vehicle: 29 for v in timestep.vehicle: 30 print('%s %s %s %s %s 0 0' 31 % (timestep.time, v.x, v.y, v.z, v.angle), file=outSTRM)
def
fcd2ipg(inpFCD, outSTRM, further):