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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SumoCommandAdd a new vehicle.static SumoCommandaddFull(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 SumoCommandchangeLane(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 SumoCommandchangeSublane(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 SumoCommandchangeTarget(String vehID, String edgeID) The vehicle's destination edge is set to the given.static SumoCommandReturns the acceleration of the named vehicle within the last step.static SumoCommandgetAccumulatedWaitingTime(String vehID) Returns the vehicle class.static SumoCommandgetActionStepLength(String vehID) Returns the action step length for this vehicle.static SumoCommandgetAdaptedTraveltime(String vehID, double time, String edgeID) Returns the edge travel time for the given time as stored in the vehicle's internal container.static SumoCommandgetAllowedSpeed(String vehID) Returns the maximum allowed speed on the current lane regarding speed factor in m/s for this vehicle.static SumoCommandReturns the angle of the named vehicle within the last time step.static SumoCommandgetApparentDecel(String vehID) Returns the apparent deceleration in m/s^2 of this vehicle.static SumoCommandgetBestLanes(String vehID) getBestLanes.static SumoCommandgetCO2Emission(String vehID) Returns the CO2 emission in mg for the last time step.static SumoCommandgetCOEmission(String vehID) Returns the CO emission in mg for the last time step.static SumoCommandReturns the vehicle's color (RGBA).static SumoCommandReturns the deceleration of the named vehicle within the last time step.static SumoCommandgetDistance(String vehID) Get the distance to the starting point acts as a odometer.static SumoCommandgetDrivingDistance(String vehID, String edgeID, double pos, byte laneID) Returns the driving distance (in m) of the named vehicle within the last tine step.static SumoCommandgetDrivingDistance2D(String vehID, double x, double y) getDrivingDistance2D.static SumoCommandReturns the edge effort for the given time as stored in the vehicle's internal container.static SumoCommandgetElectricityConsumption(String vehID) Returns the electricity consumption in ml for the last time step.static SumoCommandgetEmergencyDecel(String vehID) Returns the maximal physically possible deceleration in m/s^2 of this vehicle.static SumoCommandgetEmissionClass(String vehID) Returns the emission class of the named vehicle.static SumoCommandgetFuelConsumption(String vehID) Returns the fuel consumption in ml for the last time step.static SumoCommandgetHCEmission(String vehID) Returns the HC emission (in mg) during the last time step.static SumoCommandReturns the height in m of this vehicle.static SumoCommandReturns the number of all vehicles in the network.static SumoCommandReturns a list of ids of all vehicles currently running within the scenario.static SumoCommandgetImperfection(String vehID) getImperfection.static SumoCommandgetLaneChangeMode(String vehID) Gets the vehicle's lane change mode as a bitset.static SumoCommandgetLaneChangeState(String vehID, int direction) Returns the maximal physically possible deceleration in m/s^2 of this vehicle.static SumoCommandReturns the id of the lane the named vehicle was at within the last step.static SumoCommandgetLaneIndex(String vehID) Returns the index of the lane the named vehicle was at within the last step.static SumoCommandgetLanePosition(String vehID) Returns the position of the vehicle along the lane (in m).static SumoCommandgetLastActionTime(String vehID) Returns the time of last action point for this vehicle.static SumoCommandgetLateralAlignment(String vehID) Returns The preferred lateral alignment of the vehicle.static SumoCommandgetLateralLanePosition(String vehID) Returns The lateral position of the vehicle on its current lane measured in m.static SumoCommandReturn the leading vehicle id together with the distance.static SumoCommandReturns the length (in m) of the named vehicle.static SumoCommandReturns the length (in m) of the named vehicle.static SumoCommandgetMaxSpeed(String vehID) Returns the maximum speed(in m/s) of the named vehicle.static SumoCommandgetMaxSpeedLat(String vehID) Returns the maximum lateral speed in m/s of this vehicle.static SumoCommandReturns the minimum gap (in m) between this vehicle and the vehicle before it.static SumoCommandgetMinGapLat(String vehID) Returns The desired lateral gap of this vehicle at 50km/h in m.static SumoCommandgetNextStops(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 SumoCommandgetNextTLS(String vehID) Return list of upcoming traffic lights [(tlsID, tlsIndex, distance, state), ...]static SumoCommandgetNoiseEmission(String vehID) Returns the noise emission (in db) generated by the vehicle during the last time step.static SumoCommandgetNOxEmission(String vehID) Returns the NOx emissions (in mg) generated by the vehicle during the last time step.static SumoCommandgetParameter(String vehID, String param) Returns the chosen parameter.static SumoCommandgetPersonIDList(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 SumoCommandgetPersonNumber(String vehID) getPersonNumber.static SumoCommandgetPMxEmission(String vehID) Returns the particular matter emissions (in mg) generated by the vehicle during the last time step.static SumoCommandgetPosition(String vehID) Returns the position of the named vehicle within the last step [m,m].static SumoCommandgetPosition3D(String vehID) Returns the position of the named vehicle within the last step [m,m,m].static SumoCommandReturns the id of the edge the named vehicle was at within the last step.static SumoCommandReturns the ids of the edges the vehicle's route is made of.static SumoCommandgetRouteID(String vehID) Returns the id of the route of the named vehicle.static SumoCommandgetRouteIndex(String vehID) Returns the index of the current edge within the vehicles route or -1 if the vehicle has not yet departed.static SumoCommandgetRoutingMode(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 SumoCommandgetShapeClass(String vehID) getShapeClass.static SumoCommandgetSignals(String vehID) getSignals.static SumoCommandgetSlope.static SumoCommandReturns the speed (in m/s) of the named vehicle within the last step.static SumoCommandgetSpeedDeviation(String vehID) Returns the standard deviation of the estimated maximum speed (see speed factor) divided by this speed.static SumoCommandgetSpeedFactor(String vehID) Returns the factor by which the driver multiplies the speed read from street signs to estimate "real" maximum allowed speed.static SumoCommandgetSpeedMode(String vehID) Returns the speed mode of a vehicle.static SumoCommandgetSpeedWithoutTraCI(String vehID) getSpeedWithoutTraCI.static SumoCommandgetStopState(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 SumoCommandgetTau.static SumoCommandReturns the id of the type of the named vehicle.static SumoCommandgetVehicleClass(String vehID) Returns the vehicle class.static SumoCommandReturns the ids of via edges for this vehicle.static SumoCommandgetWaitingTime(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 SumoCommandReturns the vehicle's width (in m).static SumoCommandisAtBusStop(String vehID) isAtBusStop.static SumoCommandisAtContainerStop(String vehID) Return whether the vehicle is stopped at a container stop.static SumoCommandisRouteValid(String vehID) Returns whether the Route is valid.static SumoCommandisStopped.static SumoCommandisStoppedParking(String vehID) isStoppedParking.static SumoCommandisStoppedTriggered(String vehID) Return whether the vehicle is stopped and waiting for a person or container.static SumoCommandMoves the vehicle to a new position.static SumoCommandPlace vehicle at the given x,y coordinates and force it's angle to the given value (for drawing).static SumoCommandRemoves vehicle with the given ID for the given reason.static SumoCommandrerouteEffort(String vehID) Computes a new route using the vehicle's internal and the global edge effort information.static SumoCommandrerouteParkingArea(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 SumoCommandrerouteTraveltime(String vehID) Computes a new route using the vehicle's internal and the global edge travel time information.static SumoCommandContinue after a stop.static SumoCommandSets the acceleration of the named vehicle.static SumoCommandsetActionStepLength(String vehID, double actionStepLength, boolean resetActionOffset) Sets the action step length for this vehicle.static SumoCommandsetAdaptedTraveltime(String vehID, double begTime, double endTime, String edgeID, double time) Sets the edge travel time of the named vehicle.static SumoCommandsetApparentDecel(String vehID, double decel) Sets the apparent deceleration in m/s^2 for this vehicle.static SumoCommandsetBusStop(String vehID, String stopID, double duration, double until) Adds or modifies a bus stop with the given parameters.static SumoCommandsetChargingStationStop(String vehID, String stopID, double duration, double until) Adds or modifies a stop at a chargingStation with the given parameters.static SumoCommandSets the vehicle's color (RGBA).static SumoCommandsetContainerStop(String vehID, String stopID, double duration, double until) Adds or modifies a container stop with the given parameters.static SumoCommandSets the deceleration of the named vehicle.static SumoCommandSets the edge effort for the given time as stored in the vehicle's internal container.static SumoCommandsetEmergencyDecel(String vehID, double decel) Sets the maximal physically possible deceleration in m/s^2 for this vehicle.static SumoCommandsetEmissionClass(String vehID, String clazz) Sets the emission class of the named vehicle.static SumoCommandSets the height in m for this vehicle.static SumoCommandsetImperfection(String vehID, double imperfection) setImperfection.static SumoCommandsetLaneChangeMode(String vehID, int lcm) Sets the vehicle's lane change mode as a bitset.static SumoCommandsetLateralAlignment(String vehID, String align) Sets the preferred lateral alignment for this vehicle.static SumoCommandSets the length (in m) of the named vehicle.static SumoCommandSets the line information for this vehicle.static SumoCommandsetMaxSpeed(String vehID, double speed) Sets the maximum speed (in m/s) of the named vehicle.static SumoCommandsetMaxSpeedLat(String vehID, double speed) Sets the maximum lateral speed in m/s for this vehicle.static SumoCommandSets the minimum gap (in m) between this vehicle and the vehicle before it.static SumoCommandsetMinGapLat(String vehID, double minGapLat) Sets the minimum lateral gap of the vehicle at 50km/h in m.static SumoCommandsetParameter(String vehID, String param, String value) Sets the chosen parameter.static SumoCommandsetParkingAreaStop(String vehID, String stopID, double duration, double until) Adds or modifies a stop at a parkingArea with the given parameters.static SumoCommandsetRoute(String vehID, SumoStringList edgeList) Sets the IDs of the edges the vehicle's route is made of.static SumoCommandsetRouteID(String vehID, String routeID) Sets the id of the route of the named vehicle.static SumoCommandsetRoutingMode(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 SumoCommandsetShapeClass(String vehID, String clazz) setShapeClass.static SumoCommandsetSignals(String vehID, int signals) setSignals.static SumoCommandSets the speed (in m/s) of the named vehicle.static SumoCommandsetSpeedDeviation(String vehID, double deviation) Sets the standard deviation of the estimated maximum speed.static SumoCommandsetSpeedFactor(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 SumoCommandsetSpeedMode(String vehID, int sm) Sets the vehicle's speed mode as a bitset.static SumoCommandsetStop(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 SumoCommandsetTau.static SumoCommandSets the id of the type for the named vehicle.static SumoCommandsetVehicleClass(String vehID, String clazz) Sets the vehicle class.static SumoCommandsetVia(String vehID, SumoStringList edgeList) Sets the line information for this vehicle.static SumoCommandSets the vehicle's width (in m).static SumoCommandReduces the speed to the given for the given amount of time.static SumoCommandupdateBestLanes(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
-