traci.vehicle | index /home/behr_mi/sumo/tools/traci/vehicle.py

`@file vehicle.py
@author Michael Behrisch
@author Lena Kalleske
@date 2011-03-09
@version $Id: vehicle.py 13752 2013-04-27 06:06:24Z behrisch $
Python implementation of the TraCI interface.
SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
Copyright (C) 2011 DLR (http://www.dlr.de/) and contributors
All rights reserved`

Modules
`` |  |
struct | traci.constants | traci |

Functions
`` |  | add(vehID, routeID, depart=-2, pos=0, speed=0, lane=0, typeID='DEFAULT_VEHTYPE') changeLane(vehID, laneIndex, duration) changeTarget(vehID, edgeID) getAccel(vehID) `getAccel(string) -> double .` getAdaptedTraveltime(vehID, time, edgeID) `getAdaptedTraveltime(string, double, string) -> double .` getAngle(vehID) `getAngle(string) -> double .` getBestLanes(vehID) `getBestLanes(string) -> .` getCO2Emission(vehID) `getCO2Emission(string) -> double Returns the CO2 emission in mg for the last time step.` getCOEmission(vehID) `getCOEmission(string) -> double Returns the CO emission in mg for the last time step.` getColor(vehID) `getColor(string) -> (integer, integer, integer, integer) .` getContextSubscriptionResults(vehID=None) getDecel(vehID) `getDecel(string) -> double .` getDrivingDistance(vehID, edgeID, pos, laneID=0) `getDrivingDistance(string, string, double, integer) -> double .` getDrivingDistance2D(vehID, x, y) `getDrivingDistance2D(string, double, double) -> integer .` getEffort(vehID, time, edgeID) `getEffort(string, double, string) -> double .` getEmissionClass(vehID) `getEmissionClass(string) -> string .` getFuelConsumption(vehID) `getFuelConsumption(string) -> double Returns the fuel consumption in ml for the last time step.` getHCEmission(vehID) `getHCEmission(string) -> double Returns the HC emission in mg for the last time step.` getIDList() `getIDList() -> list(string) Returns a list of all known vehicles.` getImperfection(vehID) `getImperfection(string) -> double .` getLaneID(vehID) `getLaneID(string) -> string .` getLaneIndex(vehID) `getLaneIndex(string) -> integer .` getLanePosition(vehID) `getLanePosition(string) -> double .` getLength(vehID) `getLength(string) -> double .` getMaxSpeed(vehID) `getMaxSpeed(string) -> double .` getMinGap(vehID) `getMinGap(string) -> double .` getNOxEmission(vehID) `getNOxEmission(string) -> double Returns the NOx emission in mg for the last time step.` getNoiseEmission(vehID) `getNoiseEmission(string) -> double Returns the noise emission in db for the last time step.` getPMxEmission(vehID) `getPMxEmission(string) -> double Returns the particular matter emission in mg for the last time step.` getPosition(vehID) `getPosition(string) -> (double, double) Returns the position of the named vehicle within the last step [m,m].` getRoadID(vehID) `getRoadID(string) -> string .` getRoute(vehID) `getRoute(string) -> list(string) .` getRouteID(vehID) `getRouteID(string) -> string .` getShapeClass(vehID) `getShapeClass(string) -> string .` getSignals(vehID) `getSignals(string) -> integer .` getSpeed(vehID) `getSpeed(string) -> double .` getSpeedDeviation(vehID) `getSpeedDeviation(string) -> double .` getSpeedFactor(vehID) `getSpeedFactor(string) -> double .` getSpeedWithoutTraCI(vehID) `getSpeedWithoutTraCI(string) -> double .` getSubscriptionResults(vehID=None) `getSubscriptionResults(string) -> dict(integer: <value_type>) Returns the subscription results for the last time step and the given vehicle. If no vehicle id is given, all subscription results are returned in a dict. If the vehicle id is unknown or the subscription did for any reason return no data, 'None' is returned. It is not possible to retrieve older subscription results than the ones from the last time step.` getTau(vehID) `getTau(string) -> double .` getTypeID(vehID) `getTypeID(string) -> string .` getVehicleClass(vehID) `getVehicleClass(string) -> string .` getWidth(vehID) `getWidth(string) -> double .` isRouteValid(vehID) moveTo(vehID, laneID, pos) moveToVTD(vehID, edgeID, lane, x, y) remove(vehID, reason=3) `Remove vehicle with the given ID for the give reason. Reasons are defined in module constants and start with REMOVE_` rerouteEffort(vehID) rerouteTraveltime(vehID) setAccel(vehID, accel) setAdaptedTraveltime(vehID, begTime, endTime, edgeID, time) setColor(vehID, color) `setColor(string, (integer, integer, integer, integer)) sets color for vehicle with the given ID. i.e. (255,0,0,0) for the color red. The fourth integer (alpha) is currently ignored` setDecel(vehID, decel) setEffort(vehID, begTime, endTime, edgeID, effort) setEmissionClass(vehID, clazz) setImperfection(vehID, imperfection) setLength(vehID, length) setMaxSpeed(vehID, speed) setMinGap(vehID, minGap) setRoute(vehID, edgeList) `changes the vehicle route to given edges list. The first edge in the list has to be the one that the vehicle is at at the moment. example usage: setRoute('1', ['1', '2', '4', '6', '7']) this changes route for vehicle id 1 to edges 1-2-4-6-7` setRouteID(vehID, routeID) setShapeClass(vehID, clazz) setSignals(vehID, signals) setSpeed(vehID, speed) setSpeedDeviation(vehID, deviation) setSpeedFactor(vehID, factor) setStop(vehID, edgeID, pos=1.0, laneIndex=0, duration=2147483647) setTau(vehID, tau) setVehicleClass(vehID, clazz) setWidth(vehID, width) slowDown(vehID, speed, duration) subscribe(vehID, varIDs=(80, 86), begin=0, end=2147483647) `subscribe(string, list(integer), double, double) -> None Subscribe to one or more vehicle values for the given interval. A call to this method clears all previous subscription results.` subscribeContext(vehID, domain, dist, varIDs=(80, 86), begin=0, end=2147483647)

Data
`` |  | DEPART_NOW = -2 DEPART_TRIGGERED = -1 subscriptionResults = <traci.SubscriptionResults instance>