Package de.tudresden.sumo.cmd
Class Vehicle
java.lang.Object
de.tudresden.sumo.cmd.Vehicle
The Class Vehicle.
- Author:
- Mario Krumnow, Evamarie Wiessner
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic SumoCommand
Add a new vehicle.static SumoCommand
addFull
(String vehID, String routeID, String typeID, String depart, String departLane, String departPosition, String departSpeed, String arrivalLane, String arrivalPosition, String arrivalSpeed, String fromTAZ, String toTAZ, String line, int person_capacity, int person_number) Add a new vehicle.static SumoCommand
changeLane
(String vehID, byte laneIndex, double duration) Forces a lane change to the lane with the given index; if successful, the lane will be chosen for the given amount of time.static SumoCommand
changeSublane
(String vehID, double latDist) 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.static SumoCommand
changeTarget
(String vehID, String edgeID) The vehicle's destination edge is set to the given.static SumoCommand
Returns the acceleration of the named vehicle within the last step.static SumoCommand
getAccumulatedWaitingTime
(String vehID) Returns the vehicle class.static SumoCommand
getActionStepLength
(String vehID) Returns the action step length for this vehicle.static SumoCommand
getAdaptedTraveltime
(String vehID, double time, String edgeID) Returns the edge travel time for the given time as stored in the vehicle's internal container.static SumoCommand
getAllowedSpeed
(String vehID) Returns the maximum allowed speed on the current lane regarding speed factor in m/s for this vehicle.static SumoCommand
Returns the angle of the named vehicle within the last time step.static SumoCommand
getApparentDecel
(String vehID) Returns the apparent deceleration in m/s^2 of this vehicle.static SumoCommand
getBestLanes
(String vehID) getBestLanes.static SumoCommand
getCO2Emission
(String vehID) Returns the CO2 emission in mg for the last time step.static SumoCommand
getCOEmission
(String vehID) Returns the CO emission in mg for the last time step.static SumoCommand
Returns the vehicle's color (RGBA).static SumoCommand
Returns the deceleration of the named vehicle within the last time step.static SumoCommand
getDistance
(String vehID) Get the distance to the starting point acts as a odometer.static SumoCommand
getDrivingDistance
(String vehID, String edgeID, double pos, byte laneID) Returns the driving distance (in m) of the named vehicle within the last tine step.static SumoCommand
getDrivingDistance2D
(String vehID, double x, double y) getDrivingDistance2D.static SumoCommand
Returns the edge effort for the given time as stored in the vehicle's internal container.static SumoCommand
getElectricityConsumption
(String vehID) Returns the electricity consumption in ml for the last time step.static SumoCommand
getEmergencyDecel
(String vehID) Returns the maximal physically possible deceleration in m/s^2 of this vehicle.static SumoCommand
getEmissionClass
(String vehID) Returns the emission class of the named vehicle.static SumoCommand
getFuelConsumption
(String vehID) Returns the fuel consumption in ml for the last time step.static SumoCommand
getHCEmission
(String vehID) Returns the HC emission (in mg) during the last time step.static SumoCommand
Returns the height in m of this vehicle.static SumoCommand
Returns the number of all vehicles in the network.static SumoCommand
Returns a list of ids of all vehicles currently running within the scenario.static SumoCommand
getImperfection
(String vehID) getImperfection.static SumoCommand
getLaneChangeMode
(String vehID) Gets the vehicle's lane change mode as a bitset.static SumoCommand
getLaneChangeState
(String vehID, int direction) Returns the maximal physically possible deceleration in m/s^2 of this vehicle.static SumoCommand
Returns the id of the lane the named vehicle was at within the last step.static SumoCommand
getLaneIndex
(String vehID) Returns the index of the lane the named vehicle was at within the last step.static SumoCommand
getLanePosition
(String vehID) Returns the position of the vehicle along the lane (in m).static SumoCommand
getLastActionTime
(String vehID) Returns the time of last action point for this vehicle.static SumoCommand
getLateralAlignment
(String vehID) Returns The preferred lateral alignment of the vehicle.static SumoCommand
getLateralLanePosition
(String vehID) Returns The lateral position of the vehicle on its current lane measured in m.static SumoCommand
Return the leading vehicle id together with the distance.static SumoCommand
Returns the length (in m) of the named vehicle.static SumoCommand
Returns the length (in m) of the named vehicle.static SumoCommand
getMaxSpeed
(String vehID) Returns the maximum speed(in m/s) of the named vehicle.static SumoCommand
getMaxSpeedLat
(String vehID) Returns the maximum lateral speed in m/s of this vehicle.static SumoCommand
Returns the minimum gap (in m) between this vehicle and the vehicle before it.static SumoCommand
getMinGapLat
(String vehID) Returns The desired lateral gap of this vehicle at 50km/h in m.static SumoCommand
getNextStops
(String vehID) Return list of upcoming stops [(lane, endPos, stoppingPlaceID, stopFlags, duration, until), ...] where integer stopFlag is defined as: 1 * stopped + 2 * parking + 4 * personTriggered + 8 * containerTriggered + 16 * isBusStop + 32 * isContainerStop + 64 * chargingStation + 128 * parkingarea with each of these flags defined as 0 or 1.static SumoCommand
getNextTLS
(String vehID) Return list of upcoming traffic lights [(tlsID, tlsIndex, distance, state), ...]static SumoCommand
getNoiseEmission
(String vehID) Returns the noise emission (in db) generated by the vehicle during the last time step.static SumoCommand
getNOxEmission
(String vehID) Returns the NOx emissions (in mg) generated by the vehicle during the last time step.static SumoCommand
getParameter
(String vehID, String param) Returns the chosen parameter.static SumoCommand
getPersonIDList
(String vehID) Returns the list of persons which includes those defined using attribute 'personNumber' as well as person-objects which are riding in this vehicle.static SumoCommand
getPersonNumber
(String vehID) getPersonNumber.static SumoCommand
getPMxEmission
(String vehID) Returns the particular matter emissions (in mg) generated by the vehicle during the last time step.static SumoCommand
getPosition
(String vehID) Returns the position of the named vehicle within the last step [m,m].static SumoCommand
getPosition3D
(String vehID) Returns the position of the named vehicle within the last step [m,m,m].static SumoCommand
Returns the id of the edge the named vehicle was at within the last step.static SumoCommand
Returns the ids of the edges the vehicle's route is made of.static SumoCommand
getRouteID
(String vehID) Returns the id of the route of the named vehicle.static SumoCommand
getRouteIndex
(String vehID) Returns the index of the current edge within the vehicles route or -1 if the vehicle has not yet departed.static SumoCommand
getRoutingMode
(String vehID) returns the current routing mode: tc.ROUTING_MODE_DEFAULT : use weight storages and fall-back to edge speeds (default) tc.ROUTING_MODE_AGGREGATED : use global smoothed travel times from device.reroutingstatic SumoCommand
getShapeClass
(String vehID) getShapeClass.static SumoCommand
getSignals
(String vehID) getSignals.static SumoCommand
getSlope.static SumoCommand
Returns the speed (in m/s) of the named vehicle within the last step.static SumoCommand
getSpeedDeviation
(String vehID) Returns the standard deviation of the estimated maximum speed (see speed factor) divided by this speed.static SumoCommand
getSpeedFactor
(String vehID) Returns the factor by which the driver multiplies the speed read from street signs to estimate "real" maximum allowed speed.static SumoCommand
getSpeedMode
(String vehID) Returns the speed mode of a vehicle.static SumoCommand
getSpeedWithoutTraCI
(String vehID) getSpeedWithoutTraCI.static SumoCommand
getStopState
(String vehID) 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.static SumoCommand
getTau.static SumoCommand
Returns the id of the type of the named vehicle.static SumoCommand
getVehicleClass
(String vehID) Returns the vehicle class.static SumoCommand
Returns the ids of via edges for this vehicle.static SumoCommand
getWaitingTime
(String vehID) 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.static SumoCommand
Returns the vehicle's width (in m).static SumoCommand
isAtBusStop
(String vehID) isAtBusStop.static SumoCommand
isAtContainerStop
(String vehID) Return whether the vehicle is stopped at a container stop.static SumoCommand
isRouteValid
(String vehID) Returns whether the Route is valid.static SumoCommand
isStopped.static SumoCommand
isStoppedParking
(String vehID) isStoppedParking.static SumoCommand
isStoppedTriggered
(String vehID) Return whether the vehicle is stopped and waiting for a person or container.static SumoCommand
Moves the vehicle to a new position.static SumoCommand
Place vehicle at the given x,y coordinates and force it's angle to the given value (for drawing).static SumoCommand
Removes vehicle with the given ID for the given reason.static SumoCommand
rerouteEffort
(String vehID) Computes a new route using the vehicle's internal and the global edge effort information.static SumoCommand
rerouteParkingArea
(String vehID, String parkingAreaID) Changes the next parking area in parkingAreaID, updates the vehicle route, and preserve consistency in case of passengers/containers on board.static SumoCommand
rerouteTraveltime
(String vehID) Computes a new route using the vehicle's internal and the global edge travel time information.static SumoCommand
Continue after a stop.static SumoCommand
Sets the acceleration of the named vehicle.static SumoCommand
setActionStepLength
(String vehID, double actionStepLength, boolean resetActionOffset) Sets the action step length for this vehicle.static SumoCommand
setAdaptedTraveltime
(String vehID, double begTime, double endTime, String edgeID, double time) Sets the edge travel time of the named vehicle.static SumoCommand
setApparentDecel
(String vehID, double decel) Sets the apparent deceleration in m/s^2 for this vehicle.static SumoCommand
setBusStop
(String vehID, String stopID, double duration, double until) Adds or modifies a bus stop with the given parameters.static SumoCommand
setChargingStationStop
(String vehID, String stopID, double duration, double until) Adds or modifies a stop at a chargingStation with the given parameters.static SumoCommand
Sets the vehicle's color (RGBA).static SumoCommand
setContainerStop
(String vehID, String stopID, double duration, double until) Adds or modifies a container stop with the given parameters.static SumoCommand
Sets the deceleration of the named vehicle.static SumoCommand
Sets the edge effort for the given time as stored in the vehicle's internal container.static SumoCommand
setEmergencyDecel
(String vehID, double decel) Sets the maximal physically possible deceleration in m/s^2 for this vehicle.static SumoCommand
setEmissionClass
(String vehID, String clazz) Sets the emission class of the named vehicle.static SumoCommand
Sets the height in m for this vehicle.static SumoCommand
setImperfection
(String vehID, double imperfection) setImperfection.static SumoCommand
setLaneChangeMode
(String vehID, int lcm) Sets the vehicle's lane change mode as a bitset.static SumoCommand
setLateralAlignment
(String vehID, String align) Sets the preferred lateral alignment for this vehicle.static SumoCommand
Sets the length (in m) of the named vehicle.static SumoCommand
Sets the line information for this vehicle.static SumoCommand
setMaxSpeed
(String vehID, double speed) Sets the maximum speed (in m/s) of the named vehicle.static SumoCommand
setMaxSpeedLat
(String vehID, double speed) Sets the maximum lateral speed in m/s for this vehicle.static SumoCommand
Sets the minimum gap (in m) between this vehicle and the vehicle before it.static SumoCommand
setMinGapLat
(String vehID, double minGapLat) Sets the minimum lateral gap of the vehicle at 50km/h in m.static SumoCommand
setParameter
(String vehID, String param, String value) Sets the chosen parameter.static SumoCommand
setParkingAreaStop
(String vehID, String stopID, double duration, double until) Adds or modifies a stop at a parkingArea with the given parameters.static SumoCommand
setRoute
(String vehID, SumoStringList edgeList) Sets the IDs of the edges the vehicle's route is made of.static SumoCommand
setRouteID
(String vehID, String routeID) Sets the id of the route of the named vehicle.static SumoCommand
setRoutingMode
(String vehID, int routingMode) sets the current routing mode: tc.ROUTING_MODE_DEFAULT : use weight storages and fall-back to edge speeds (default) tc.ROUTING_MODE_AGGREGATED : use global smoothed travel times from device.reroutingstatic SumoCommand
setShapeClass
(String vehID, String clazz) setShapeClass.static SumoCommand
setSignals
(String vehID, int signals) setSignals.static SumoCommand
Sets the speed (in m/s) of the named vehicle.static SumoCommand
setSpeedDeviation
(String vehID, double deviation) Sets the standard deviation of the estimated maximum speed.static SumoCommand
setSpeedFactor
(String vehID, double factor) Sets the factor by which the driver multiplies the speed read from street signs to estimate "real" maximum allowed speed.static SumoCommand
setSpeedMode
(String vehID, int sm) Sets the vehicle's speed mode as a bitset.static SumoCommand
setStop
(String vehID, String edgeID, double pos, byte laneIndex, double duration, SumoStopFlags sf, double startPos, double until) Lets the vehicle stop at the given edge, at the given position and lane.static SumoCommand
setTau.static SumoCommand
Sets the id of the type for the named vehicle.static SumoCommand
setVehicleClass
(String vehID, String clazz) Sets the vehicle class.static SumoCommand
setVia
(String vehID, SumoStringList edgeList) Sets the line information for this vehicle.static SumoCommand
Sets the vehicle's width (in m).static SumoCommand
Reduces the speed to the given for the given amount of time.static SumoCommand
updateBestLanes
(String vehID) 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.
-
Constructor Details
-
Vehicle
public Vehicle()
-
-
Method Details
-
getAccel
Returns the acceleration of the named vehicle within the last step.- Parameters:
vehID
- id of the vehicle- Returns:
- acceleration
-
getActionStepLength
Returns the action step length for this vehicle.- Parameters:
vehID
- id of the vehicle- Returns:
- action step length for this vehicle
-
getIDCount
Returns the number of all vehicles in the network.- Returns:
- current number of vehicles in the network
-
getAdaptedTraveltime
Returns the edge travel time for the given time as stored in the vehicle's internal container.- Parameters:
vehID
- id of the vehicletime
- timeedgeID
- id of the edge- Returns:
- SumoCommand
-
getAngle
Returns the angle of the named vehicle within the last time step.- Parameters:
vehID
- id of the vehicle- Returns:
- angle
-
getApparentDecel
Returns the apparent deceleration in m/s^2 of this vehicle.- Parameters:
vehID
- id of the vehicle- Returns:
- angle
-
getMaxSpeedLat
Returns the maximum lateral speed in m/s of this vehicle.- Parameters:
vehID
- id of the vehicle- Returns:
- angle
-
getMinGapLat
Returns The desired lateral gap of this vehicle at 50km/h in m.- Parameters:
vehID
- id of the vehicle- Returns:
- angle
-
getAllowedSpeed
Returns the maximum allowed speed on the current lane regarding speed factor in m/s for this vehicle.- Parameters:
vehID
- id of the vehicle- Returns:
- allowed speed
-
getHeight
Returns the height in m of this vehicle.- Parameters:
vehID
- id of the vehicle- Returns:
- height in m
-
getLateralLanePosition
Returns The lateral position of the vehicle on its current lane measured in m.- Parameters:
vehID
- id of the vehicle- Returns:
- the leading vehicle
-
getLaneChangeState
Returns the maximal physically possible deceleration in m/s^2 of this vehicle.- Parameters:
vehID
- id of the vehicledirection
- direction- Returns:
- SumoCommand
-
getEmergencyDecel
Returns the maximal physically possible deceleration in m/s^2 of this vehicle.- Parameters:
vehID
- id of the vehicle- Returns:
- SumoCommand
-
getLastActionTime
Returns the time of last action point for this vehicle.- Parameters:
vehID
- id of the vehicle- Returns:
- time of last action point for this vehicle.
-
getLateralAlignment
Returns The preferred lateral alignment of the vehicle.- Parameters:
vehID
- id of the vehicle- Returns:
- the leading vehicle
-
getLaneChangeMode
Gets the vehicle's lane change mode as a bitset.- Parameters:
vehID
- id of the vehicle- Returns:
- vehicle's lane change mode as a bitset.
-
getLeader
Return the leading vehicle id together with the distance. The dist parameter defines the maximum lookahead, 0 calculates a lookahead from the brake gap.- Parameters:
vehID
- id of the vehicledist
- distance- Returns:
- the leading vehicle
-
getPersonNumber
getPersonNumber.- Parameters:
vehID
- id of the vehicle- Returns:
- person number
-
getBestLanes
getBestLanes.- Parameters:
vehID
- id of the vehicle- Returns:
- list of the best lanes
-
getCO2Emission
Returns the CO2 emission in mg for the last time step.- Parameters:
vehID
- id of the vehicle- Returns:
- value for co2
-
getCOEmission
Returns the CO emission in mg for the last time step.- Parameters:
vehID
- id of the vehicle- Returns:
- value for co2
-
getColor
Returns the vehicle's color (RGBA).- Parameters:
vehID
- id of the vehicle- Returns:
- color
-
getDecel
Returns the deceleration of the named vehicle within the last time step.- Parameters:
vehID
- id of the vehicle- Returns:
- deceleration
-
getDrivingDistance
Returns the driving distance (in m) of the named vehicle within the last tine step.- Parameters:
vehID
- idedgeID
- edge idpos
- poslaneID
- lane id- Returns:
- the distance
-
getDrivingDistance2D
getDrivingDistance2D.- Parameters:
vehID
- id of the vehiclex
- xy
- y- Returns:
- the distance
-
getDistance
Get the distance to the starting point acts as a odometer.- Parameters:
vehID
- id of the vehicle- Returns:
- the current distance of the vehicle (odometer)
-
getEffort
Returns the edge effort for the given time as stored in the vehicle's internal container.- Parameters:
vehID
- id of the vehicletime
- timeedgeID
- edge id- Returns:
- the effort
-
getEmissionClass
Returns the emission class of the named vehicle.- Parameters:
vehID
- id of the vehicle- Returns:
- emission class
-
getElectricityConsumption
Returns the electricity consumption in ml for the last time step.- Parameters:
vehID
- id of the vehicle- Returns:
- energy consumption
-
getFuelConsumption
Returns the fuel consumption in ml for the last time step.- Parameters:
vehID
- id of the vehicle- Returns:
- fuel consumption
-
getHCEmission
Returns the HC emission (in mg) during the last time step.- Parameters:
vehID
- id of the vehicle- Returns:
- value for hc
-
getIDList
Returns a list of ids of all vehicles currently running within the scenario.- Returns:
- list of vehicles
-
getImperfection
getImperfection.- Parameters:
vehID
- id of the vehicle- Returns:
- value for imperfection
-
getLaneID
Returns the id of the lane the named vehicle was at within the last step.- Parameters:
vehID
- id of the vehicle- Returns:
- lane id
-
getLaneIndex
Returns the index of the lane the named vehicle was at within the last step.- Parameters:
vehID
- id of the vehicle- Returns:
- lane index
-
getLanePosition
Returns the position of the vehicle along the lane (in m).- Parameters:
vehID
- id of the vehicle- Returns:
- lane position
-
getLength
Returns the length (in m) of the named vehicle.- Parameters:
vehID
- id of the vehicle- Returns:
- length
-
getLine
Returns the length (in m) of the named vehicle.- Parameters:
vehID
- id of the vehicle- Returns:
- length
-
getMaxSpeed
Returns the maximum speed(in m/s) of the named vehicle.- Parameters:
vehID
- id of the vehicle- Returns:
- max speed
-
getMinGap
Returns the minimum gap (in m) between this vehicle and the vehicle before it.- Parameters:
vehID
- id of the vehicle- Returns:
- min gap
-
getNextTLS
Return list of upcoming traffic lights [(tlsID, tlsIndex, distance, state), ...]- Parameters:
vehID
- id of the vehicle- Returns:
- next traffic lights (compound)
-
getNextStops
Return list of upcoming stops [(lane, endPos, stoppingPlaceID, stopFlags, duration, until), ...] where integer stopFlag is defined as: 1 * stopped + 2 * parking + 4 * personTriggered + 8 * containerTriggered + 16 * isBusStop + 32 * isContainerStop + 64 * chargingStation + 128 * parkingarea with each of these flags defined as 0 or 1.- Parameters:
vehID
- id of the vehicle- Returns:
- next traffic lights (compound)
-
getNOxEmission
Returns the NOx emissions (in mg) generated by the vehicle during the last time step.- Parameters:
vehID
- id of the vehicle- Returns:
- value for nox
-
getNoiseEmission
Returns the noise emission (in db) generated by the vehicle during the last time step.- Parameters:
vehID
- id of the vehicle- Returns:
- value for noise emission
-
getParameter
Returns the chosen parameter.- Parameters:
vehID
- a string identifying the vehicleparam
- a string identifying the parameter- Returns:
- SumoCommand (String)
-
setParameter
Sets the chosen parameter.- Parameters:
vehID
- a string identifying the vehicleparam
- a string identifying the parametervalue
- a string identifying the new value- Returns:
- SumoCommand
-
getPMxEmission
Returns the particular matter emissions (in mg) generated by the vehicle during the last time step.- Parameters:
vehID
- id of the vehicle- Returns:
- value for pmx
-
getPosition
Returns the position of the named vehicle within the last step [m,m].- Parameters:
vehID
- id of the vehicle- Returns:
- position 2D
-
getPosition3D
Returns the position of the named vehicle within the last step [m,m,m].- Parameters:
vehID
- id of the vehicle- Returns:
- position 3D
-
getRoadID
Returns the id of the edge the named vehicle was at within the last step.- Parameters:
vehID
- id of the vehicle- Returns:
- road id
-
getRoute
Returns the ids of the edges the vehicle's route is made of.- Parameters:
vehID
- id of the vehicle- Returns:
- route
-
getRouteID
Returns the id of the route of the named vehicle.- Parameters:
vehID
- id of the vehicle- Returns:
- route id
-
getRouteIndex
Returns the index of the current edge within the vehicles route or -1 if the vehicle has not yet departed.- Parameters:
vehID
- id of the vehicle- Returns:
- route index
-
getRoutingMode
returns the current routing mode: tc.ROUTING_MODE_DEFAULT : use weight storages and fall-back to edge speeds (default) tc.ROUTING_MODE_AGGREGATED : use global smoothed travel times from device.rerouting- Parameters:
vehID
- id of the vehicle- Returns:
- current routing mode
-
getShapeClass
getShapeClass.- Parameters:
vehID
- id of the vehicle- Returns:
- shape class
-
getSignals
getSignals.- Parameters:
vehID
- id of the vehicle- Returns:
- the signal state of the vehicle
-
getSlope
getSlope.- Parameters:
vehID
- id of the vehicle- Returns:
- the slope at the current position of the vehicle in degrees
-
getSpeed
Returns the speed (in m/s) of the named vehicle within the last step.- Parameters:
vehID
- id of the vehicle- Returns:
- speed in m/s
-
getSpeedDeviation
Returns the standard deviation of the estimated maximum speed (see speed factor) divided by this speed.- Parameters:
vehID
- id of the vehicle- Returns:
- speed deviation
-
getSpeedFactor
Returns the factor by which the driver multiplies the speed read from street signs to estimate "real" maximum allowed speed.- Parameters:
vehID
- id of the vehicle- Returns:
- speed factor
-
getSpeedMode
Returns the speed mode of a vehicle.- Parameters:
vehID
- id of the vehicle- Returns:
- speed mode
-
getSpeedWithoutTraCI
getSpeedWithoutTraCI.- Parameters:
vehID
- id of the vehicle- Returns:
- speed in m/s
-
getStopState
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.- Parameters:
vehID
- id of the vehicle- Returns:
- speed in m/s
-
getTau
getTau.- Parameters:
vehID
- id of the vehicle- Returns:
- tau
-
getVia
Returns the ids of via edges for this vehicle.- Parameters:
vehID
- id of the vehicle- Returns:
- ids of via edges for this vehicle
-
getWaitingTime
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).- Parameters:
vehID
- id of the vehicle- Returns:
- waiting time
-
getTypeID
Returns the id of the type of the named vehicle.- Parameters:
vehID
- id of the vehicle- Returns:
- type id
-
getPersonIDList
Returns the list of persons which includes those defined using attribute 'personNumber' as well as person-objects which are riding in this vehicle.- Parameters:
vehID
- id of the vehicle- Returns:
- vehicle class
-
getVehicleClass
Returns the vehicle class.- Parameters:
vehID
- id of the vehicle- Returns:
- vehicle class
-
getAccumulatedWaitingTime
Returns the vehicle class.- Parameters:
vehID
- id of the vehicle- Returns:
- vehicle class
-
getWidth
Returns the vehicle's width (in m).- Parameters:
vehID
- id of the vehicle- Returns:
- width
-
isStopped
isStopped.- Parameters:
vehID
- id of the vehicle- Returns:
- stop
-
isStoppedTriggered
Return whether the vehicle is stopped and waiting for a person or container.- Parameters:
vehID
- id of the vehicle- Returns:
- stop
-
isAtContainerStop
Return whether the vehicle is stopped at a container stop.- Parameters:
vehID
- id of the vehicle- Returns:
- stop
-
isStoppedParking
isStoppedParking.- Parameters:
vehID
- id of the vehicle- Returns:
- stop
-
isAtBusStop
isAtBusStop.- Parameters:
vehID
- id of the vehicle- Returns:
- stop
-
isRouteValid
Returns whether the Route is valid.- Parameters:
vehID
- id of the vehicle- Returns:
- route valid
-
slowDown
Reduces the speed to the given for the given amount of time.- Parameters:
vehID
- id of the vehiclespeed
- speedduration
- duration- Returns:
- SumoCommand
-
add
public static SumoCommand add(String vehID, String typeID, String routeID, int depart, double pos, double speed, byte lane) Add a new vehicle.- Parameters:
vehID
- vehicle idtypeID
- type idrouteID
- route iddepart
- departpos
- positionspeed
- speedlane
- lane- Returns:
- SumoCommand
-
addFull
public static SumoCommand addFull(String vehID, String routeID, String typeID, String depart, String departLane, String departPosition, String departSpeed, String arrivalLane, String arrivalPosition, String arrivalSpeed, String fromTAZ, String toTAZ, String line, int person_capacity, int person_number) Add a new vehicle.- Parameters:
vehID
- the veh IDrouteID
- the route IDtypeID
- the type IDdepart
- the departdepartLane
- the depart lanedepartPosition
- the depart positiondepartSpeed
- the depart speedarrivalLane
- the arrival lanearrivalPosition
- the arrival positionarrivalSpeed
- the arrival speedfromTAZ
- the from TAZtoTAZ
- the to TAZline
- the lineperson_capacity
- the person capacityperson_number
- the person number- Returns:
- SumoCommand
-
changeLane
Forces a lane change to the lane with the given index; if successful, the lane will be chosen for the given amount of time.- Parameters:
vehID
- vehicle idlaneIndex
- lane indexduration
- duration- Returns:
- SumoCommand
-
changeTarget
The vehicle's destination edge is set to the given. The route is rebuilt.- Parameters:
vehID
- vehicle idedgeID
- edge id- Returns:
- SumoCommand
-
changeSublane
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.- Parameters:
vehID
- vehicle idlatDist
- latDist- Returns:
- SumoCommand
-
moveTo
Moves the vehicle to a new position.- Parameters:
vehID
- vehicle idlaneID
- lane idpos
- position- Returns:
- SumoCommand
-
moveToXY
public static SumoCommand moveToXY(String vehID, String edgeID, int lane, double x, double y, double angle, byte keepRoute) Place vehicle at the given x,y coordinates and force it's angle to the given value (for drawing). 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=1 but in addition to that may even move outside the road network. edgeID and lane are optional placement hints to resolve ambiguities- Parameters:
vehID
- vehicle idedgeID
- edge idlane
- lanex
- xy
- yangle
- anglekeepRoute
- the keep route- Returns:
- SumoCommand
-
remove
Removes vehicle with the given ID for the given reason. Reasons are defined in module constants and start with REMOVE_- Parameters:
vehID
- vehicle idreason
- reason- Returns:
- SumoCommand
-
rerouteEffort
Computes a new route using the vehicle's internal and the global edge effort information.- Parameters:
vehID
- id of the vehicle- Returns:
- SumoCommand
-
rerouteTraveltime
Computes a new route using the vehicle's internal and the global edge travel time information.- Parameters:
vehID
- id of the vehicle- Returns:
- SumoCommand
-
setAccel
Sets the acceleration of the named vehicle.- Parameters:
vehID
- id of the vehicleaccel
- acceleration- Returns:
- SumoCommand
-
setAdaptedTraveltime
public static SumoCommand setAdaptedTraveltime(String vehID, double begTime, double endTime, String edgeID, double time) Sets the edge travel time of the named vehicle.- Parameters:
vehID
- id of the vehiclebegTime
- begin timeendTime
- end timeedgeID
- edge idtime
- time- Returns:
- SumoCommand
-
setLateralAlignment
Sets the preferred lateral alignment for this vehicle.- Parameters:
vehID
- id of the vehiclealign
- align- Returns:
- SumoCommand
-
setApparentDecel
Sets the apparent deceleration in m/s^2 for this vehicle.- Parameters:
vehID
- id of the vehicledecel
- decel- Returns:
- SumoCommand
-
setMinGapLat
Sets the minimum lateral gap of the vehicle at 50km/h in m.- Parameters:
vehID
- id of the vehicleminGapLat
- minGapLat- Returns:
- SumoCommand
-
setColor
Sets the vehicle's color (RGBA).- Parameters:
vehID
- id of the vehiclecolor
- color- Returns:
- SumoCommand
-
setDecel
Sets the deceleration of the named vehicle.- Parameters:
vehID
- id of the vehicledecel
- deceleration- Returns:
- SumoCommand
-
setHeight
Sets the height in m for this vehicle.- Parameters:
vehID
- id of the vehicleheight
- in m- Returns:
- SumoCommand
-
setLaneChangeMode
Sets the vehicle's lane change mode as a bitset.- Parameters:
vehID
- id of the vehiclelcm
- lane change model- Returns:
- SumoCommand
-
setEmergencyDecel
Sets the maximal physically possible deceleration in m/s^2 for this vehicle.- Parameters:
vehID
- id of the vehicledecel
- decel- Returns:
- SumoCommand
-
setRoute
Sets the IDs of the edges the vehicle's route is made of.- Parameters:
vehID
- id of the vehicleedgeList
- edges list- Returns:
- SumoCommand
-
setRoutingMode
sets the current routing mode: tc.ROUTING_MODE_DEFAULT : use weight storages and fall-back to edge speeds (default) tc.ROUTING_MODE_AGGREGATED : use global smoothed travel times from device.rerouting- Parameters:
vehID
- id of the vehicleroutingMode
- routingMode- Returns:
- SumoCommand
-
setType
Sets the id of the type for the named vehicle.- Parameters:
vehID
- id of the vehicletypeID
- type id- Returns:
- SumoCommand
-
setEffort
public static SumoCommand setEffort(String vehID, int begTime, int endTime, String edgeID, double effort) Sets the edge effort for the given time as stored in the vehicle's internal container.- Parameters:
vehID
- id of the vehiclebegTime
- begin timeendTime
- end timeedgeID
- edge ideffort
- effort- Returns:
- SumoCommand
-
setEmissionClass
Sets the emission class of the named vehicle.- Parameters:
vehID
- id of the vehicleclazz
- emission class- Returns:
- SumoCommand
-
setImperfection
setImperfection.- Parameters:
vehID
- vehicle idimperfection
- imperfection- Returns:
- SumoCommand
-
setLength
Sets the length (in m) of the named vehicle.- Parameters:
vehID
- vehicle idlength
- length- Returns:
- SumoCommand
-
setActionStepLength
public static SumoCommand setActionStepLength(String vehID, double actionStepLength, boolean resetActionOffset) 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.- Parameters:
vehID
- vehicle idactionStepLength
- actionStepLengthresetActionOffset
- resetActionOffset- Returns:
- SumoCommand
-
setLine
Sets the line information for this vehicle.- Parameters:
vehID
- vehicle idline
- line- Returns:
- SumoCommand
-
setVia
Sets the line information for this vehicle. 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- Parameters:
vehID
- vehicle idedgeList
- edges- Returns:
- SumoCommand
-
setMaxSpeed
Sets the maximum speed (in m/s) of the named vehicle.- Parameters:
vehID
- vehicle idspeed
- speed- Returns:
- SumoCommand
-
setMaxSpeedLat
Sets the maximum lateral speed in m/s for this vehicle.- Parameters:
vehID
- vehicle idspeed
- speed- Returns:
- SumoCommand
-
setMinGap
Sets the minimum gap (in m) between this vehicle and the vehicle before it.- Parameters:
vehID
- vehicle idminGap
- minimum gap- Returns:
- SumoCommand
-
setRouteID
Sets the id of the route of the named vehicle.- Parameters:
vehID
- vehicle idrouteID
- route id- Returns:
- SumoCommand
-
setShapeClass
setShapeClass.- Parameters:
vehID
- vehicle idclazz
- shape class- Returns:
- SumoCommand
-
setSignals
setSignals.- Parameters:
vehID
- vehicle idsignals
- signals- Returns:
- SumoCommand
-
setSpeed
Sets the speed (in m/s) of the named vehicle.- Parameters:
vehID
- vehicle idspeed
- speed- Returns:
- SumoCommand
-
setSpeedDeviation
Sets the standard deviation of the estimated maximum speed.- Parameters:
vehID
- vehicle iddeviation
- deviation- Returns:
- SumoCommand
-
setSpeedFactor
Sets the factor by which the driver multiplies the speed read from street signs to estimate "real" maximum allowed speed.- Parameters:
vehID
- vehicle idfactor
- factor- Returns:
- SumoCommand
-
setSpeedMode
Sets the vehicle's speed mode as a bitset.- Parameters:
vehID
- vehicle idsm
- speed mode- Returns:
- SumoCommand
-
setStop
public static SumoCommand setStop(String vehID, String edgeID, double pos, byte laneIndex, double duration, SumoStopFlags sf, double startPos, double until) Lets the vehicle stop at the given edge, at the given position and lane. The vehicle will stop for the given duration. Re-issuing a stop command with the same lane and position allows changing the duration.- Parameters:
vehID
- vehicle idedgeID
- edge idpos
- positonlaneIndex
- lane indexduration
- durationsf
- stop flagsstartPos
- the start posuntil
- the until- Returns:
- SumoCommand
-
setChargingStationStop
public static SumoCommand setChargingStationStop(String vehID, String stopID, double duration, double until) Adds or modifies a stop at a chargingStation with the given parameters. The duration and the until attribute are in seconds.- Parameters:
vehID
- the veh IDstopID
- the stop IDduration
- the durationuntil
- the until- Returns:
- SumoCommand
-
setBusStop
Adds or modifies a bus stop with the given parameters. The duration and the until attribute are in seconds.- Parameters:
vehID
- id of the vehiclestopID
- the stop IDduration
- the durationuntil
- the until- Returns:
- SumoCommand
-
setContainerStop
public static SumoCommand setContainerStop(String vehID, String stopID, double duration, double until) Adds or modifies a container stop with the given parameters. The duration and the until attribute are in seconds.- Parameters:
vehID
- id of the vehiclestopID
- the stop IDduration
- the durationuntil
- the until- Returns:
- SumoCommand
-
setParkingAreaStop
public static SumoCommand setParkingAreaStop(String vehID, String stopID, double duration, double until) Adds or modifies a stop at a parkingArea with the given parameters. The duration and the until attribute are in seconds.- Parameters:
vehID
- vehicle idstopID
- stopIDduration
- durationuntil
- the until- Returns:
- SumoCommand
-
resume
Continue after a stop.- Parameters:
vehID
- vehicle id- Returns:
- SumoCommand
-
setTau
setTau.- Parameters:
vehID
- vehicle idtau
- tau- Returns:
- SumoCommand
-
setVehicleClass
Sets the vehicle class.- Parameters:
vehID
- vehicle idclazz
- vehicle class- Returns:
- SumoCommand
-
setWidth
Sets the vehicle's width (in m).- Parameters:
vehID
- vehicle idwidth
- width- Returns:
- SumoCommand
-
updateBestLanes
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.- Parameters:
vehID
- vehicle id- Returns:
- SumoCommand
-
rerouteParkingArea
Changes the next parking area in parkingAreaID, updates the vehicle route, and preserve consistency in case of passengers/containers on board.- Parameters:
vehID
- vehicle idparkingAreaID
- parkingAreaID- Returns:
- SumoCommand
-