| |
Methods defined here:
- __init__(self)
- add(self, vehID, routeID, depart=-3, pos=0, speed=0, lane=-6, typeID='DEFAULT_VEHTYPE')
- Add a new vehicle (old style)
- addFull(self, vehID, routeID, typeID='DEFAULT_VEHTYPE', depart=None, departLane='first', departPos='base', departSpeed='0', arrivalLane='current', arrivalPos='max', arrivalSpeed='current', fromTaz='', toTaz='', line='', personCapacity=0, personNumber=0)
- Add a new vehicle (new style with all possible parameters)
- changeLane(self, vehID, laneIndex, duration)
- changeLane(string, int, int) -> None
Forces a lane change to the lane with the given index; if successful,
the lane will be chosen for the given amount of time (in ms).
- changeSublane(self, vehID, latDist)
- changeLane(string, double) -> None
Forces a lateral change by the given amount (negative values indicate changing to the right, positive to the left)
This will override any other lane change motivations but conform to
safety-constraints as configured by laneChangeMode.
- changeTarget(self, vehID, edgeID)
- changeTarget(string, string) -> None
The vehicle's destination edge is set to the given edge id. The route is rebuilt.
- couldChangeLane(self, vehID, direction)
- couldChangeLane(string, int) -> bool
Return whether the vehicle could change lanes in the specified direction
- getAccel(self, vehID)
- getAccel(string) -> double
Returns the maximum acceleration possibility in m/s^2 of this vehicle.
- getAccumulatedWaitingTime(self, vehID)
- getAccumulatedWaitingTime() -> double
The accumulated waiting time of a vehicle collects the vehicle's waiting time
over a certain time interval (interval length is set per option '--waiting-time-memory')
- getActionStepLength(self, vehID)
- getActionStepLength(string) -> double
Returns the action step length for this vehicle.
- getAdaptedTraveltime(self, vehID, time, edgeID)
- getAdaptedTraveltime(string, double, string) -> double
.
- getAllowedSpeed(self, vehID)
- getAllowedSpeed(string) -> double
Returns the maximum allowed speed on the current lane regarding speed factor in m/s for this vehicle.
- getAngle(self, vehID)
- getAngle(string) -> double
Returns the angle in degrees of the named vehicle within the last step.
- getApparentDecel(self, vehID)
- getApparentDecel(string) -> double
Returns the apparent deceleration in m/s^2 of this vehicle.
- getBestLanes(self, vehID)
- getBestLanes(string) ->
Information about the wish to use subsequent edges' lanes.
- getCO2Emission(self, vehID)
- getCO2Emission(string) -> double
Returns the CO2 emission in mg for the last time step.
- getCOEmission(self, vehID)
- getCOEmission(string) -> double
Returns the CO emission in mg for the last time step.
- getColor(self, vehID)
- getColor(string) -> (integer, integer, integer, integer)
Returns the vehicle's rgba color.
- getDecel(self, vehID)
- getDecel(string) -> double
Returns the preferred maximal deceleration possibility in m/s^2 of this vehicle.
- getDistance(self, vehID)
- getDistance(string) -> double
Returns the distance to the starting point like an odometer
- getDrivingDistance(self, vehID, edgeID, pos, laneIndex=0)
- getDrivingDistance(string, string, double, integer) -> double
Return the distance to the given edge and position along the vehicles route.
- getDrivingDistance2D(self, vehID, x, y)
- getDrivingDistance2D(string, double, double) -> integer
Return the distance to the given network position along the vehicles route.
- getEffort(self, vehID, time, edgeID)
- getEffort(string, double, string) -> double
.
- getElectricityConsumption(self, vehID)
- getElectricityConsumption(string) -> double
Returns the electricity consumption in ml for the last time step.
- getEmergencyDecel(self, vehID)
- getEmergencyDecel(string) -> double
Returns the maximal physically possible deceleration in m/s^2 of this vehicle.
- getEmissionClass(self, vehID)
- getEmissionClass(string) -> string
Returns the emission class of this vehicle.
- getFuelConsumption(self, vehID)
- getFuelConsumption(string) -> double
Returns the fuel consumption in ml for the last time step.
- getHCEmission(self, vehID)
- getHCEmission(string) -> double
Returns the HC emission in mg for the last time step.
- getHeight(self, vehID)
- getHeight(string) -> double
Returns the height in m of this vehicle.
- getImperfection(self, vehID)
- getImperfection(string) -> double
.
- getLaneChangeState(self, vehID, direction)
- getLaneChangeState(string, int) -> (int, int)
Return the lane change state for the vehicle
- getLaneID(self, vehID)
- getLaneID(string) -> string
Returns the id of the lane the named vehicle was at within the last step.
- getLaneIndex(self, vehID)
- getLaneIndex(string) -> integer
Returns the index of the lane the named vehicle was at within the last step.
- getLanePosition(self, vehID)
- getLanePosition(string) -> double
The position of the vehicle along the lane measured in m.
- getLastActionTime(self, vehID)
- getLastActionTime(string) -> double
Returns the time of last action poitn for this vehicle.
- getLateralAlignment(self, vehID)
- getLateralAlignment(string) -> string
Returns The preferred lateral alignment of the vehicle
- getLateralLanePosition(self, vehID)
- getLateralLanePosition(string) -> double
Returns The lateral position of the vehicle on its current lane measured in m.
- getLeader(self, vehID, dist=0.0)
- getLeader(string, double) -> (string, double)
Return the leading vehicle id together with the distance. The distance
is measured from the front + minGap to the back of the leader, so it does not include the
minGap of the vehicle.
The dist parameter defines the maximum lookahead, 0 calculates a lookahead from the brake gap.
Note that the returned leader may be farther away than the given dist.
- getLength(self, vehID)
- getLength(string) -> double
Returns the length in m of the given vehicle.
- getLine(self, vehID)
- getLine(string) -> string
Returns the line information of this vehicle.
- getMaxSpeed(self, vehID)
- getMaxSpeed(string) -> double
Returns the maximum speed in m/s of this vehicle.
- getMaxSpeedLat(self, vehID)
- getMaxSpeedLat(string) -> double
Returns the maximum lateral speed in m/s of this vehicle.
- getMinGap(self, vehID)
- getMinGap(string) -> double
Returns the offset (gap to front vehicle if halting) of this vehicle.
- getMinGapLat(self, vehID)
- getMinGapLat(string) -> double
Returns The desired lateral gap of this vehicle at 50km/h in m
- getNOxEmission(self, vehID)
- getNOxEmission(string) -> double
Returns the NOx emission in mg for the last time step.
- getNextTLS(self, vehID)
- getNextTLS(string) ->
Return list of upcoming traffic lights [(tlsID, tlsIndex, distance, state), ...]
- getNoiseEmission(self, vehID)
- getNoiseEmission(string) -> double
Returns the noise emission in db for the last time step.
- getPMxEmission(self, vehID)
- getPMxEmission(string) -> double
Returns the particular matter emission in mg for the last time step.
- getPersonNumber(self, vehID)
- getPersonNumber(string) -> integer
Returns the total number of persons which includes those defined
using attribute 'personNumber' as well as <person>-objects which are riding in
this vehicle.
- getPosition(self, vehID)
- getPosition(string) -> (double, double)
Returns the position of the named vehicle within the last step [m,m].
- getPosition3D(self, vehID)
- getPosition3D(string) -> (double, double, double)
Returns the position of the named vehicle within the last step [m,m,m].
- getRoadID(self, vehID)
- getRoadID(string) -> string
Returns the id of the edge the named vehicle was at within the last step.
- getRoute(self, vehID)
- getRoute(string) -> list(string)
Returns the ids of the edges the vehicle's route is made of.
- getRouteID(self, vehID)
- getRouteID(string) -> string
Returns the id of the route of the named vehicle.
- getRouteIndex(self, vehID)
- getRouteIndex(string) -> int
Returns the index of the current edge within the vehicles route or -1 if the
vehicle has not yet departed
- getShapeClass(self, vehID)
- getShapeClass(string) -> string
Returns the shape class of this vehicle.
- getSignals(self, vehID)
- getSignals(string) -> integer
Returns an integer encoding the state of a vehicle's signals.
- getSlope(self, vehID)
- getSlope -> double
The slope at the current position of the vehicle in degrees
- getSpeed(self, vehID)
- getSpeed(string) -> double
Returns the speed in m/s of the named vehicle within the last step.
- getSpeedDeviation(self, vehID)
- getSpeedDeviation(string) -> double
Returns the standard deviation for the speed factor of the vehicle type.
- getSpeedFactor(self, vehID)
- getSpeedFactor(string) -> double
Returns the chosen speed factor for this vehicle.
- getSpeedMode(self, vehID)
- getSpeedMode -> int
The speed mode of a vehicle
- getSpeedWithoutTraCI(self, vehID)
- getSpeedWithoutTraCI(string) -> double
Returns the speed that the vehicle would drive if not speed-influencing
command such as setSpeed or slowDown was given.
- getStopState(self, vehID)
- getStopState(string) -> integer
Returns information in regard to stopping:
The returned integer is defined as 1 * stopped + 2 * parking
+ 4 * personTriggered + 8 * containerTriggered + 16 * isBusStop
+ 32 * isContainerStop
with each of these flags defined as 0 or 1
- getTau(self, vehID)
- getTau(string) -> double
Returns the driver's reaction time in s for this vehicle.
- getTypeID(self, vehID)
- getTypeID(string) -> string
Returns the id of the type of the named vehicle.
- getVehicleClass(self, vehID)
- getVehicleClass(string) -> string
Returns the vehicle class of this vehicle.
- getVia(self, vehID)
- getVia(string) -> list(string)
Returns the ids of via edges for this vehicle
- getWaitingTime(self, vehID)
- getWaitingTime() -> double
The waiting time of a vehicle is defined as the time (in seconds) spent with a
speed below 0.1m/s since the last time it was faster than 0.1m/s.
(basically, the waiting time of a vehicle is reset to 0 every time it moves).
A vehicle that is stopping intentionally with a <stop> does not accumulate waiting time.
- getWidth(self, vehID)
- getWidth(string) -> double
Returns the width in m of this vehicle.
- isAtBusStop(self, vehID)
- isAtBusStop(string) -> bool
Return whether the vehicle is stopped at a bus stop
- isAtContainerStop(self, vehID)
- isAtContainerStop(string) -> bool
Return whether the vehicle is stopped at a container stop
- isRouteValid(self, vehID)
- isRouteValid(string) -> bool
Returns whether the current vehicle route is connected for the vehicle
class of the given vehicle.
- isStopped(self, vehID)
- isStopped(string) -> bool
Return whether the vehicle is stopped
- isStoppedParking(self, vehID)
- isStoppedParking(string) -> bool
Return whether the vehicle is parking (implies stopped)
- isStoppedTriggered(self, vehID)
- isStoppedTriggered(string) -> bool
Return whether the vehicle is stopped and waiting for a person or container
- moveTo(self, vehID, laneID, pos)
- moveToVTD = moveToXY(self, vehID, edgeID, lane, x, y, angle=-1001.0, keepRoute=1)
- moveToXY(self, vehID, edgeID, lane, x, y, angle=-1001.0, keepRoute=1)
- Place vehicle at the given x,y coordinates and force it's angle to
the given value (for drawing).
If the angle is set to INVALID_DOUBLE_VALUE, the vehicle assumes the
natural angle of the edge on which it is driving.
If keepRoute is set to 1, the closest position
within the existing route is taken. If keepRoute is set to 0, the vehicle may move to
any edge in the network but it's route then only consists of that edge.
If keepRoute is set to 2 the vehicle has all the freedom of keepRoute=0
but in addition to that may even move outside the road network.
edgeID and lane are optional placement hints to resolve ambiguities
- remove(self, vehID, reason=3)
- Remove vehicle with the given ID for the give reason.
Reasons are defined in module constants and start with REMOVE_
- rerouteEffort(self, vehID)
- rerouteTraveltime(self, vehID, currentTravelTimes=True)
- rerouteTraveltime(string, bool) -> None Reroutes a vehicle. If
currentTravelTimes is True (default) then the current traveltime of the
edges is loaded and used for rerouting. If currentTravelTimes is False
custom travel times are used. The various functions and options for
customizing travel times are described at http://sumo.dlr.de/wiki/Simulation/Routing
When rerouteTraveltime has been called once with option
currentTravelTimes=True, all edge weights are set to the current travel
times at the time of that call (even for subsequent simulation steps).
- resume(self, vehID)
- resume(string) -> None
Resumes the vehicle from the current stop (throws an error if the vehicle is not stopped).
- setAccel(self, vehID, accel)
- setAccel(string, double) -> None
Sets the maximum acceleration in m/s^2 for this vehicle.
- setActionStepLength(self, vehID, actionStepLength, resetActionOffset=True)
- setActionStepLength(string, double, bool) -> None
Sets the action step length for this vehicle. If resetActionOffset == True (default), the
next action point is scheduled immediately. if If resetActionOffset == False, the interval
between the last and the next action point is updated to match the given value, or if the latter
is smaller than the time since the last action point, the next action follows immediately.
- setAdaptedTraveltime(self, vehID, edgeID, time=None, begTime=None, endTime=None)
- setAdaptedTraveltime(string, string, double, int, int) -> None
Inserts the information about the travel time of edge "edgeID" valid
from begin time to end time into the vehicle's internal edge weights
container.
If the time is not specified, any previously set values for that edge
are removed.
If begTime or endTime are not specified the value is set for the whole
simulation duration.
- setApparentDecel(self, vehID, decel)
- setApparentDecel(string, double) -> None
Sets the apparent deceleration in m/s^2 for this vehicle.
- setBusStop(self, vehID, stopID, duration=2147483647, until=-1, flags=0)
- setBusStop(string, string, integer, integer, integer) -> None
Adds or modifies a bus stop with the given parameters. The duration and the until attribute are
in milliseconds.
- setChargingStationStop(self, vehID, stopID, duration=2147483647, until=-1, flags=0)
- setChargingStationStop(string, string, integer, integer, integer) -> None
Adds or modifies a stop at a chargingStation with the given parameters. The duration and the until attribute are
in milliseconds.
- setColor(self, 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 only used when drawing vehicles with raster images
- setContainerStop(self, vehID, stopID, duration=2147483647, until=-1, flags=0)
- setContainerStop(string, string, integer, integer, integer) -> None
Adds or modifies a container stop with the given parameters. The duration and the until attribute are
in milliseconds.
- setDecel(self, vehID, decel)
- setDecel(string, double) -> None
Sets the preferred maximal deceleration in m/s^2 for this vehicle.
- setEffort(self, vehID, edgeID, effort=None, begTime=None, endTime=None)
- setEffort(string, string, double, int, int) -> None
Inserts the information about the effort of edge "edgeID" valid from
begin time to end time into the vehicle's internal edge weights
container.
If the time is not specified, any previously set values for that edge
are removed.
If begTime or endTime are not specified the value is set for the whole
simulation duration.
- setEmergencyDecel(self, vehID, decel)
- setEmergencyDecel(string, double) -> None
Sets the maximal physically possible deceleration in m/s^2 for this vehicle.
- setEmissionClass(self, vehID, clazz)
- setEmissionClass(string, string) -> None
Sets the emission class for this vehicle.
- setHeight(self, vehID, height)
- setHeight(string, double) -> None
Sets the height in m for this vehicle.
- setImperfection(self, vehID, imperfection)
- setImperfection(string, double) -> None
Sets the driver imperfection sigma.
- setLaneChangeMode(self, vehID, lcm)
- setLaneChangeMode(string, integer) -> None
Sets the vehicle's lane change mode as a bitset.
- setLateralAlignment(self, vehID, align)
- setLateralAlignment(string, string) -> None
Sets the preferred lateral alignment for this vehicle.
- setLength(self, vehID, length)
- setLength(string, double) -> None
Sets the length in m for the given vehicle.
- setLine(self, vehID, line)
- setHeight(string, string) -> None
Sets the line information for this vehicle.
- setMaxSpeed(self, vehID, speed)
- setMaxSpeed(string, double) -> None
Sets the maximum speed in m/s for this vehicle.
- setMaxSpeedLat(self, vehID, speed)
- setMaxSpeedLat(string, double) -> None
Sets the maximum lateral speed in m/s for this vehicle.
- setMinGap(self, vehID, minGap)
- setMinGap(string, double) -> None
Sets the offset (gap to front vehicle if halting) for this vehicle.
- setMinGapLat(self, vehID, minGapLat)
- setMinGapLat(string, double) -> None
Sets the minimum lateral gap of the vehicle at 50km/h in m
- setParkingAreaStop(self, vehID, stopID, duration=2147483647, until=-1, flags=1)
- setParkingAreaStop(string, string, integer, integer, integer) -> None
Adds or modifies a stop at a parkingArea with the given parameters. The duration and the until attribute are
in milliseconds.
- setRoute(self, vehID, edgeList)
- setRoute(string, list) -> None
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(self, vehID, routeID)
- setRouteID(string, string) -> None
Changes the vehicles route to the route with the given id.
- setShapeClass(self, vehID, clazz)
- setShapeClass(string, string) -> None
Sets the shape class for this vehicle.
- setSignals(self, vehID, signals)
- setSignals(string, integer) -> None
Sets an integer encoding the state of the vehicle's signals.
- setSpeed(self, vehID, speed)
- setSpeed(string, double) -> None
Sets the speed in m/s for the named vehicle within the last step.
- setSpeedFactor(self, vehID, factor)
- setSpeedFactor(string, double) -> None
.
- setSpeedMode(self, vehID, sm)
- setSpeedMode(string, integer) -> None
Sets the vehicle's speed mode as a bitset.
- setStop(self, vehID, edgeID, pos=1.0, laneIndex=0, duration=2147483647, flags=0, startPos=-1001.0, until=-1)
- setStop(string, string, double, integer, integer, integer, double, integer) -> None
Adds or modifies a stop with the given parameters. The duration and the until attribute are
in milliseconds.
- setTau(self, vehID, tau)
- setTau(string, double) -> None
Sets the driver's tau-parameter (reaction time or anticipation time depending on the car-following model) in s for this vehicle.
- setType(self, vehID, typeID)
- setType(string, string) -> None
Sets the id of the type for the named vehicle.
- setVehicleClass(self, vehID, clazz)
- setVehicleClass(string, string) -> None
Sets the vehicle class for this vehicle.
- setVia(self, vehID, edgeList)
- setVia(string, list) -> None
changes the via edges to the given edges list (to be used during
subsequent rerouting calls).
Note: a single edgeId as argument is allowed as shorthand for a list of length 1
- setWidth(self, vehID, width)
- setWidth(string, double) -> None
Sets the width in m for this vehicle.
- slowDown(self, vehID, speed, duration)
- slowDown(string, double, int) -> None
Changes the speed smoothly to the given value over the given amount
of time in ms (can also be used to increase speed).
- subscribe(self, objectID, varIDs=(80, 86), begin=0, end=2147483647)
- subscribe(string, list(integer), int, int) -> None
Subscribe to one or more object values for the given interval.
- subscribeContext(self, objectID, domain, dist, varIDs=(80, 86), begin=0, end=2147483647)
- subscribe(string, int, double, list(integer), int, int) -> None
Subscribe to one or more object values of the given domain around the
given objectID in a given radius
- subscribeLeader(self, vehID, dist=0.0, begin=0, end=2147483647)
- subscribeLeader(string, double) -> None
Subscribe for the leading vehicle id together with the distance.
The dist parameter defines the maximum lookahead, 0 calculates a lookahead from the brake gap.
- wantsAndCouldChangeLane(self, vehID, direction)
- wantsAndCouldChangeLane(string, int) -> bool
Return whether the vehicle wants to and could change lanes in the specified direction
Data and other attributes defined here:
- DEPART_CONTAINER_TRIGGERED = -2
- DEPART_LANE_ALLOWED_FREE = -4
- DEPART_LANE_BEST_FREE = -5
- DEPART_LANE_FIRST_ALLOWED = -6
- DEPART_LANE_FREE = -3
- DEPART_LANE_RANDOM = -2
- DEPART_NOW = -3
- DEPART_SPEED_MAX = -3
- DEPART_SPEED_RANDOM = -2
- DEPART_TRIGGERED = -1
- LAST_TRAVEL_TIME_UPDATE = -1
- STOP_BUS_STOP = 8
- STOP_CHARGING_STATION = 32
- STOP_CONTAINER_STOP = 16
- STOP_CONTAINER_TRIGGERED = 4
- STOP_DEFAULT = 0
- STOP_PARKING = 1
- STOP_PARKING_AREA = 64
- STOP_TRIGGERED = 2
Methods inherited from traci.domain.Domain:
- getContextSubscriptionResults(self, objectID=None)
- getIDCount(self)
- getIDCount() -> integer
Returns the number of currently loaded objects.
- getIDList(self)
- getIDList() -> list(string)
Returns a list of all objects in the network.
- getParameter(self, objID, param)
- getParameter(string, string) -> string
Returns the value of the given parameter for the given objID
- getSubscriptionResults(self, objectID=None)
- getSubscriptionResults(string) -> dict(integer: <value_type>)
Returns the subscription results for the last time step and the given object.
If no object id is given, all subscription results are returned in a dict.
If the object 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.
- setParameter(self, objID, param, value)
- setParameter(string, string, string) -> string
Sets the value of the given parameter to value for the given objID
- unsubscribe(self, objectID)
- unsubscribe(string) -> None
Unsubscribe from receiving object values.
- unsubscribeContext(self, objectID, domain, dist)
|