Package de.tudresden.sumo.cmd
Class Person
java.lang.Object
de.tudresden.sumo.cmd.Person
The Class Person.
- Author:
- Mario Krumnow
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic SumoCommandInserts a new person to the simulation at the given edge, position and time (in s).static SumoCommandappendDrivingStage(String personID, String toEdge, String lines, String stopID) Appends a driving stage to the plan of the given person The lines parameter should be a space-separated list of line ids.static SumoCommandappendWaitingStage(String personID, double duration, String description, String stopID) Appends a waiting stage with duration in s to the plan of the given person.static SumoCommandappendWalkingStage(String personID, SumoStringList edges, double arrivalPos, double duration, double speed, String stopID) 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.static SumoCommandget angle.static SumoCommandget lane position.static SumoCommandget edges.static SumoCommandget edges.static SumoCommandReturns the number of all persons in the network.static SumoCommandReturns a list of personIDs of all persons.static SumoCommandgetLanePosition(String personID) get lane position.static SumoCommandget length.static SumoCommandget minGap.static SumoCommandgetNextEdge(String personID) get next edge.static SumoCommandgetParameter(String personID, String param) Returns the chosen parameter.static SumoCommandgetPersonNumber(String personID) get person number.static SumoCommandgetPosition(String personID) get position.static SumoCommandgetPosition3D(String personID) get position3D.static SumoCommandgetRemainingStages(String personID) get remaining stages.static SumoCommandget road ID.static SumoCommandget speed.static SumoCommandget stage.static SumoCommandget type ID.static SumoCommandgetVehicle(String personID) get vehicle.static SumoCommandgetWaitingTime(String personID) get waiting time.static SumoCommandget width.static SumoCommandPlace person at the given x,y coordinates and force it's angle to the given value (for drawing).static SumoCommandremoveStage(String personID, int nextStageIndex) 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.static SumoCommandrerouteTraveltime(String personID) rerouteTraveltime Computes a new route for the person using the global edge traveltime information.static SumoCommandsets color for person with the given ID.static SumoCommandSets the height in m for this person.static SumoCommandSets the length in m for the given person.static SumoCommandSets the offset (gap to front person if halting) for this vehicle.static SumoCommandsetParameter(String personID, String param, String value) Sets the chosen parameter.static SumoCommandSets the maximum speed in m/s for the named person for subsequent step.static SumoCommandSets the id of the type for the named person.static SumoCommandSets the width in m for this person.
- 
Constructor Details- 
Personpublic Person()
 
- 
- 
Method Details- 
addpublic static SumoCommand add(String personID, String edgeID, double pos, double depart, String typeID) 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.- Parameters:
- personID- a string personIDentifying the person
- edgeID- edgeID
- pos- pos
- depart- depart
- typeID- typeID
- Returns:
- the sumo command
 
- 
appendWaitingStagepublic static SumoCommand appendWaitingStage(String personID, double duration, String description, String stopID) Appends a waiting stage with duration in s to the plan of the given person.- Parameters:
- personID- a string personIDentifying the person
- duration- duration
- description- description
- stopID- stopID
- Returns:
- the sumo command
 
- 
appendWalkingStagepublic static SumoCommand appendWalkingStage(String personID, SumoStringList edges, double arrivalPos, double duration, double speed, String stopID) 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.- Parameters:
- personID- a string personIDentifying the person
- edges- edges
- arrivalPos- arrivalPos
- duration- duration
- speed- speed
- stopID- stopID
- Returns:
- the sumo command
 
- 
appendDrivingStagepublic static SumoCommand appendDrivingStage(String personID, String toEdge, String lines, String stopID) Appends a driving stage to the plan of the given person The lines parameter should be a space-separated list of line ids.- Parameters:
- personID- a string personIDentifying the person
- toEdge- toEdge
- lines- lines
- stopID- stopID
- Returns:
- the sumo command
 
- 
removeStageRemoves 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.- Parameters:
- personID- a string personIDentifying the person
- nextStageIndex- nextStageIndex
- Returns:
- the sumo command
 
- 
setSpeedSets the maximum speed in m/s for the named person for subsequent step.- Parameters:
- personID- a string personIDentifying the person
- speed- speed
- Returns:
- the sumo command
 
- 
setTypeSets the id of the type for the named person.- Parameters:
- personID- a string personIDentifying the person
- typeID- typeID
- Returns:
- the sumo command
 
- 
setWidthSets the width in m for this person.- Parameters:
- personID- a string personIDentifying the person
- width- width
- Returns:
- the sumo command
 
- 
setHeightSets the height in m for this person.- Parameters:
- personID- a string personIDentifying the person
- height- height
- Returns:
- the sumo command
 
- 
setLengthSets the length in m for the given person.- Parameters:
- personID- a string personIDentifying the person
- length- length
- Returns:
- the sumo command
 
- 
setMinGapSets the offset (gap to front person if halting) for this vehicle.- Parameters:
- personID- a string personIDentifying the person
- minGap- minGap
- Returns:
- the sumo command
 
- 
setColorsets 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- Parameters:
- personID- a string personIDentifying the person
- color- color
- Returns:
- the sumo command
 
- 
getColorget lane position.- Parameters:
- personID- a string personIDentifying the person
- Returns:
- The position of the person along the lane measured in m.
 
- 
getLengthget length.- Parameters:
- personID- a string personIDentifying the person
- Returns:
- Returns the length in m of the given person.
 
- 
getWaitingTimeget waiting time.- Parameters:
- personID- a string personIDentifying the person
- Returns:
- 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).
 
- 
getWidthget width.- Parameters:
- personID- a string personIDentifying the person
- Returns:
- Returns the width in m of this person.
 
- 
getNextEdgeget next edge.- Parameters:
- personID- a string personIDentifying the person
- Returns:
- 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.
 
- 
getEdgesget edges.- Parameters:
- personID- a string personIDentifying the person
- Returns:
- 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.
 
- 
getEdgesget edges.- Parameters:
- personID- a string personIDentifying the person
- nextStageIndex- the next stage index
- Returns:
- Returns a list of all edges in the 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)
 
- 
getStageget stage.- Parameters:
- personID- a string personIDentifying the person
- nextStageIndex- the next stage index
- Returns:
- 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)
 
- 
getRemainingStagesget remaining stages.- Parameters:
- personID- a string personIDentifying the person
- Returns:
- Returns the number of remaining stages (at least 1)
 
- 
getVehicleget vehicle.- Parameters:
- personID- a string personIDentifying the person
- Returns:
- Returns the id of the current vehicle if the person is in stage driving and has entered a vehicle. Return the empty string otherwise
 
- 
getLanePositionget lane position.- Parameters:
- personID- a string personIDentifying the person
- Returns:
- The position of the person along the lane measured in m.
 
- 
getIDCountReturns the number of all persons in the network.- Returns:
- the number of persons in the network
 
- 
getIDListReturns a list of personIDs of all persons.- Returns:
- list of IDs of all persons
 
- 
getParameterReturns the chosen parameter.- Parameters:
- personID- a string personIDentifying the person
- param- a string personIDentifying the parameter
- Returns:
- the specific parameter
 
- 
setParameterSets the chosen parameter.- Parameters:
- personID- the person ID
- param- a string identifying the parameter
- value- a string identifying the new value
- Returns:
- SumoCommand
 
- 
getSpeedget speed.- Parameters:
- personID- a string personIDentifying the person
- Returns:
- the speed in m/s
 
- 
getPositionget position.- Parameters:
- personID- a string personIDentifying the person
- Returns:
- the position 2D
 
- 
getPosition3Dget position3D.- Parameters:
- personID- a string personIDentifying the person
- Returns:
- the position 3D
 
- 
getAngleget angle.- Parameters:
- personID- a string personIDentifying the person
- Returns:
- the angle
 
- 
getRoadIDget road ID.- Parameters:
- personID- a string personIDentifying the person
- Returns:
- the personID of the road
 
- 
getTypeIDget type ID.- Parameters:
- personID- a string personIDentifying the person
- Returns:
- the type ID of the person
 
- 
getPersonNumberget person number.- Parameters:
- personID- a string personIDentifying the person
- Returns:
- the person number
 
- 
getMinGapget minGap.- Parameters:
- personID- a string personIDentifying the person
- Returns:
- the value for the minimum Ggap of the person
 
- 
rerouteTraveltimererouteTraveltime Computes a new route for the person using the global edge traveltime information.- Parameters:
- personID- a string personIDentifying the person
- Returns:
- SumoComand
 
- 
moveToXYpublic static SumoCommand moveToXY(String personID, String edgeID, double x, double y, double angle, byte keepRoute) Place person 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 person has all the freedom of keepRoute=0 but in addition to that may even move outside the road network. edgeID is an optional placement hint to resolve ambiguities- Parameters:
- personID- person id
- edgeID- edge id
- x- x
- y- y
- angle- angle
- keepRoute- the keep route
- Returns:
- SumoCommand
 
 
-