traci._person
index
/build/sumo-c71KiA/sumo-0.30.0+dfsg1/tools/traci/_person.py

@file    person.py
@author  Jakob Erdmann
@date    2015-02-06
@version $Id: _person.py 23179 2017-03-02 08:32:15Z behrisch $
 
Python implementation of the TraCI interface.
 
SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
Copyright (C) 2011-2017 DLR (http://www.dlr.de/) and contributors
 
This file is part of SUMO.
SUMO is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

 
Modules
       
struct
traci.constants

 
Classes
       
traci.domain.Domain
PersonDomain

 
class PersonDomain(traci.domain.Domain)
     Methods defined here:
__init__(self)
add(self, personID, edgeID, pos, depart=-3, typeID='DEFAULT_PEDTYPE')
add(string, string, double, int, string)
Inserts a new person to the simulation at the given edge, position and
time (in s). This function should be followed by appending Stages or the person
will immediatly vanish on departure.
appendDrivingStage(self, personID, toEdge, lines, stopID='')
appendDrivingStage(string, string, string, string)
Appends a driving stage to the plan of the given person
The lines parameter should be a space-separated list of line ids
appendWaitingStage(self, personID, duration, description='waiting', stopID='')
appendWaitingStage(string, int, string, string)
Appends a waiting stage with duration in s to the plan of the given person
appendWalkingStage(self, personID, edges, arrivalPos, duration=-1, speed=-1, stopID='')
appendWalkingStage(string, stringList, double, int, double, string)
Appends a walking stage to the plan of the given person
The walking speed can either be specified, computed from the duration parameter (in s) or taken from the type of the person
getAngle(self, personID)
getAngle(string) -> double
 
Returns the angle in degrees of the named person within the last step.
getColor(self, personID)
getColor(string) -> (integer, integer, integer, integer)
 
Returns the person's rgba color.
getEdges(self, personID, nextStageIndex=0)
getEdges(string, int) -> list(string)
 
Returns a list of all edges in the nth next stage.
For waiting stages this is a single edge
For walking stages this is the complete route
For driving stages this is [origin, destination]
 
nextStageIndex 0 retrieves value for the current stage.
nextStageIndex must be lower then value of getRemainingStages(personID)
getLanePosition(self, personID)
getLanePosition(string) -> double
 
The position of the person along the lane measured in m.
getLength(self, personID)
getLength(string) -> double
 
Returns the length in m of the given person.
getMinGap(self, personID)
getMinGap(string) -> double
 
Returns the offset (gap to front person if halting) of this person.
getNextEdge(self, personID)
getNextEdge() -> string
If the person is walking, returns the next edge on the persons route
(including crossing and walkingareas). If there is no further edge or the
person is in another stage, returns the empty string.
getPosition(self, personID)
getPosition(string) -> (double, double)
 
Returns the position of the named person within the last step [m,m].
getPosition3D(self, personID)
getPosition(string) -> (double, double, double)
 
Returns the position of the named person within the last step [m,m,m].
getRemainingStages(self, personID)
getStage(string) -> int
Returns the number of remaining stages (at least 1)
getRoadID(self, personID)
getRoadID(string) -> string
 
Returns the id of the edge the named person was at within the last step.
getSpeed(self, personID)
getSpeed(string) -> double
 
Returns the speed in m/s of the named person within the last step.
getStage(self, personID, nextStageIndex=0)
getStage(string, int) -> int
Returns the type of the nth next stage
  0 for not-yet-departed
  1 for waiting
  2 for walking
  3 for driving
nextStageIndex 0 retrieves value for the current stage.
nextStageIndex must be lower then value of getRemainingStages(personID)
getTypeID(self, personID)
getTypeID(string) -> string
 
Returns the id of the type of the named person.
getVehicle(self, personID)
getVehicle(string) -> string
Returns the id of the current vehicle if the person is in stage driving
and has entered a vehicle.
Return the empty string otherwise
getWaitingTime(self, personID)
getWaitingTime() -> double
The waiting time of a person 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 person is reset to 0 every time it moves).
getWidth(self, personID)
getWidth(string) -> double
 
Returns the width in m of this person.
removeStage(self, personID, nextStageIndex)
removeStage(string, int)
Removes the nth next stage
nextStageIndex must be lower then value of getRemainingStages(personID)
nextStageIndex 0 immediately aborts the current stage and proceeds to the next stage
removeStages(self, personID)
remove(string)
Removes all stages of the person. If no new phases are appended,
the person will be removed from the simulation in the next simulationStep().
setColor(self, personID, color)
setColor(string, (integer, integer, integer, integer))
sets color for person with the given ID.
i.e. (255,0,0,0) for the color red.
The fourth integer (alpha) is only used when drawing persons with raster images
setHeight(self, personID, height)
setHeight(string, double) -> None
 
Sets the height in m for this person.
setLength(self, personID, length)
setLength(string, double) -> None
 
Sets the length in m for the given person.
setMinGap(self, personID, minGap)
setMinGap(string, double) -> None
 
Sets the offset (gap to front person if halting) for this vehicle.
setSpeed(self, personID, speed)
setSpeed(string, double) -> None
 
Sets the maximum speed in m/s for the named person for subsequent step.
setType(self, personID, typeID)
setType(string, string) -> None
 
Sets the id of the type for the named person.
setWidth(self, personID, width)
setWidth(string, double) -> None
 
Sets the width in m for this person.

Data and other attributes defined here:
DEPART_NOW = -3

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
subscribe(self, objectID, varIDs=None, begin=0, end=2147483647)
subscribe(string, list(integer), double, double) -> None
 
Subscribe to one or more object values for the given interval.
subscribeContext(self, objectID, domain, dist, varIDs=None, begin=0, end=2147483647)
subscribeContext(string, int, double, list(integer), double, double) -> None
 
Subscribe to objects of the given domain (specified as domain=traci.constants.CMD_GET_<DOMAIN>_VARIABLE),
which are closer than dist to the object specified by objectID.
unsubscribe(self, objectID)
unsubscribe(string) -> None
 
Unsubscribe from receiving object values.
unsubscribeContext(self, objectID, domain, dist)

 
Data
        absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)