Package de.tudresden.sumo.cmd
Class Vehicle
- java.lang.Object
-
- de.tudresden.sumo.cmd.Vehicle
-
public class Vehicle extends Object
The Class Vehicle.- Author:
- Mario Krumnow, Evamarie Wiessner
-
-
Constructor Summary
Constructors Constructor Description Vehicle()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SumoCommand
add(String vehID, String typeID, String routeID, int depart, double pos, double speed, byte lane)
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
getAccel(String vehID)
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
getAngle(String vehID)
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
getColor(String vehID)
Returns the vehicle's color (RGBA).static SumoCommand
getDecel(String vehID)
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
getEffort(String vehID, double time, String edgeID)
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
getHeight(String vehID)
Returns the height in m of this vehicle.static SumoCommand
getIDCount()
Returns the number of all vehicles in the network.static SumoCommand
getIDList()
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
getLaneID(String vehID)
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
getLeader(String vehID, double dist)
Return the leading vehicle id together with the distance.static SumoCommand
getLength(String vehID)
Returns the length (in m) of the named vehicle.static SumoCommand
getLine(String vehID)
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
getMinGap(String vehID)
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
getRoadID(String vehID)
Returns the id of the edge the named vehicle was at within the last step.static SumoCommand
getRoute(String vehID)
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(String vehID)
getSlope.static SumoCommand
getSpeed(String vehID)
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(String vehID)
getTau.static SumoCommand
getTypeID(String vehID)
Returns the id of the type of the named vehicle.static SumoCommand
getVehicleClass(String vehID)
Returns the vehicle class.static SumoCommand
getVia(String vehID)
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
getWidth(String vehID)
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(String vehID)
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
moveTo(String vehID, String laneID, double pos)
Moves the vehicle to a new position.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).static SumoCommand
remove(String vehID, byte reason)
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
resume(String vehID)
Continue after a stop.static SumoCommand
setAccel(String vehID, double accel)
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
setColor(String vehID, SumoColor color)
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
setDecel(String vehID, double decel)
Sets the deceleration of the named vehicle.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.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
setHeight(String vehID, double height)
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
setLength(String vehID, double length)
Sets the length (in m) of the named vehicle.static SumoCommand
setLine(String vehID, String line)
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
setMinGap(String vehID, double minGap)
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
setSpeed(String vehID, double speed)
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(String vehID, double tau)
setTau.static SumoCommand
setType(String vehID, String typeID)
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
setWidth(String vehID, double width)
Sets the vehicle's width (in m).static SumoCommand
slowDown(String vehID, double speed, double duration)
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.
-
-
-
Method Detail
-
getAccel
public static SumoCommand getAccel(String vehID)
Returns the acceleration of the named vehicle within the last step.- Parameters:
vehID
- id of the vehicle- Returns:
- acceleration
-
getActionStepLength
public static SumoCommand getActionStepLength(String vehID)
Returns the action step length for this vehicle.- Parameters:
vehID
- id of the vehicle- Returns:
- action step length for this vehicle
-
getIDCount
public static SumoCommand getIDCount()
Returns the number of all vehicles in the network.- Returns:
- current number of vehicles in the network
-
getAdaptedTraveltime
public 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.- Parameters:
vehID
- id of the vehicletime
- timeedgeID
- id of the edge- Returns:
- SumoCommand
-
getAngle
public static SumoCommand getAngle(String vehID)
Returns the angle of the named vehicle within the last time step.- Parameters:
vehID
- id of the vehicle- Returns:
- angle
-
getApparentDecel
public static SumoCommand getApparentDecel(String vehID)
Returns the apparent deceleration in m/s^2 of this vehicle.- Parameters:
vehID
- id of the vehicle- Returns:
- angle
-
getMaxSpeedLat
public static SumoCommand getMaxSpeedLat(String vehID)
Returns the maximum lateral speed in m/s of this vehicle.- Parameters:
vehID
- id of the vehicle- Returns:
- angle
-
getMinGapLat
public static SumoCommand getMinGapLat(String vehID)
Returns The desired lateral gap of this vehicle at 50km/h in m.- Parameters:
vehID
- id of the vehicle- Returns:
- angle
-
getAllowedSpeed
public static SumoCommand getAllowedSpeed(String vehID)
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
public static SumoCommand getHeight(String vehID)
Returns the height in m of this vehicle.- Parameters:
vehID
- id of the vehicle- Returns:
- height in m
-
getLateralLanePosition
public static SumoCommand getLateralLanePosition(String vehID)
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
public static SumoCommand getLaneChangeState(String vehID, int direction)
Returns the maximal physically possible deceleration in m/s^2 of this vehicle.- Parameters:
vehID
- id of the vehicledirection
- direction- Returns:
- SumoCommand
-
getEmergencyDecel
public static SumoCommand getEmergencyDecel(String vehID)
Returns the maximal physically possible deceleration in m/s^2 of this vehicle.- Parameters:
vehID
- id of the vehicle- Returns:
- SumoCommand
-
getLastActionTime
public static SumoCommand getLastActionTime(String vehID)
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
public static SumoCommand getLateralAlignment(String vehID)
Returns The preferred lateral alignment of the vehicle.- Parameters:
vehID
- id of the vehicle- Returns:
- the leading vehicle
-
getLaneChangeMode
public static SumoCommand getLaneChangeMode(String vehID)
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
public static SumoCommand getLeader(String vehID, double dist)
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
public static SumoCommand getPersonNumber(String vehID)
getPersonNumber.- Parameters:
vehID
- id of the vehicle- Returns:
- person number
-
getBestLanes
public static SumoCommand getBestLanes(String vehID)
getBestLanes.- Parameters:
vehID
- id of the vehicle- Returns:
- list of the best lanes
-
getCO2Emission
public static SumoCommand getCO2Emission(String vehID)
Returns the CO2 emission in mg for the last time step.- Parameters:
vehID
- id of the vehicle- Returns:
- value for co2
-
getCOEmission
public static SumoCommand getCOEmission(String vehID)
Returns the CO emission in mg for the last time step.- Parameters:
vehID
- id of the vehicle- Returns:
- value for co2
-
getColor
public static SumoCommand getColor(String vehID)
Returns the vehicle's color (RGBA).- Parameters:
vehID
- id of the vehicle- Returns:
- color
-
getDecel
public static SumoCommand getDecel(String vehID)
Returns the deceleration of the named vehicle within the last time step.- Parameters:
vehID
- id of the vehicle- Returns:
- deceleration
-
getDrivingDistance
public 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.- Parameters:
vehID
- idedgeID
- edge idpos
- poslaneID
- lane id- Returns:
- the distance
-
getDrivingDistance2D
public static SumoCommand getDrivingDistance2D(String vehID, double x, double y)
getDrivingDistance2D.- Parameters:
vehID
- id of the vehiclex
- xy
- y- Returns:
- the distance
-
getDistance
public static SumoCommand getDistance(String vehID)
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
public static SumoCommand getEffort(String vehID, double time, String edgeID)
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
public static SumoCommand getEmissionClass(String vehID)
Returns the emission class of the named vehicle.- Parameters:
vehID
- id of the vehicle- Returns:
- emission class
-
getElectricityConsumption
public static SumoCommand getElectricityConsumption(String vehID)
Returns the electricity consumption in ml for the last time step.- Parameters:
vehID
- id of the vehicle- Returns:
- energy consumption
-
getFuelConsumption
public static SumoCommand getFuelConsumption(String vehID)
Returns the fuel consumption in ml for the last time step.- Parameters:
vehID
- id of the vehicle- Returns:
- fuel consumption
-
getHCEmission
public static SumoCommand getHCEmission(String vehID)
Returns the HC emission (in mg) during the last time step.- Parameters:
vehID
- id of the vehicle- Returns:
- value for hc
-
getIDList
public static SumoCommand getIDList()
Returns a list of ids of all vehicles currently running within the scenario.- Returns:
- list of vehicles
-
getImperfection
public static SumoCommand getImperfection(String vehID)
getImperfection.- Parameters:
vehID
- id of the vehicle- Returns:
- value for imperfection
-
getLaneID
public static SumoCommand getLaneID(String vehID)
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
public static SumoCommand getLaneIndex(String vehID)
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
public static SumoCommand getLanePosition(String vehID)
Returns the position of the vehicle along the lane (in m).- Parameters:
vehID
- id of the vehicle- Returns:
- lane position
-
getLength
public static SumoCommand getLength(String vehID)
Returns the length (in m) of the named vehicle.- Parameters:
vehID
- id of the vehicle- Returns:
- length
-
getLine
public static SumoCommand getLine(String vehID)
Returns the length (in m) of the named vehicle.- Parameters:
vehID
- id of the vehicle- Returns:
- length
-
getMaxSpeed
public static SumoCommand getMaxSpeed(String vehID)
Returns the maximum speed(in m/s) of the named vehicle.- Parameters:
vehID
- id of the vehicle- Returns:
- max speed
-
getMinGap
public static SumoCommand getMinGap(String vehID)
Returns the minimum gap (in m) between this vehicle and the vehicle before it.- Parameters:
vehID
- id of the vehicle- Returns:
- min gap
-
getNextTLS
public static SumoCommand getNextTLS(String vehID)
Return list of upcoming traffic lights [(tlsID, tlsIndex, distance, state), ...]- Parameters:
vehID
- id of the vehicle- Returns:
- next traffic lights (compound)
-
getNextStops
public 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.- Parameters:
vehID
- id of the vehicle- Returns:
- next traffic lights (compound)
-
getNOxEmission
public static SumoCommand getNOxEmission(String vehID)
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
public static SumoCommand getNoiseEmission(String vehID)
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
public static SumoCommand getParameter(String vehID, String param)
Returns the chosen parameter.- Parameters:
vehID
- a string identifying the vehicleparam
- a string identifying the parameter- Returns:
- SumoCommand (String)
-
setParameter
public static SumoCommand setParameter(String vehID, String param, String value)
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
public static SumoCommand getPMxEmission(String vehID)
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
public static SumoCommand getPosition(String vehID)
Returns the position of the named vehicle within the last step [m,m].- Parameters:
vehID
- id of the vehicle- Returns:
- position 2D
-
getPosition3D
public static SumoCommand getPosition3D(String vehID)
Returns the position of the named vehicle within the last step [m,m,m].- Parameters:
vehID
- id of the vehicle- Returns:
- position 3D
-
getRoadID
public static SumoCommand getRoadID(String vehID)
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
public static SumoCommand getRoute(String vehID)
Returns the ids of the edges the vehicle's route is made of.- Parameters:
vehID
- id of the vehicle- Returns:
- route
-
getRouteID
public static SumoCommand getRouteID(String vehID)
Returns the id of the route of the named vehicle.- Parameters:
vehID
- id of the vehicle- Returns:
- route id
-
getRouteIndex
public 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.- Parameters:
vehID
- id of the vehicle- Returns:
- route index
-
getRoutingMode
public 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.rerouting- Parameters:
vehID
- id of the vehicle- Returns:
- current routing mode
-
getShapeClass
public static SumoCommand getShapeClass(String vehID)
getShapeClass.- Parameters:
vehID
- id of the vehicle- Returns:
- shape class
-
getSignals
public static SumoCommand getSignals(String vehID)
getSignals.- Parameters:
vehID
- id of the vehicle- Returns:
- the signal state of the vehicle
-
getSlope
public static SumoCommand getSlope(String vehID)
getSlope.- Parameters:
vehID
- id of the vehicle- Returns:
- the slope at the current position of the vehicle in degrees
-
getSpeed
public static SumoCommand getSpeed(String vehID)
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
public static SumoCommand getSpeedDeviation(String vehID)
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
public 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.- Parameters:
vehID
- id of the vehicle- Returns:
- speed factor
-
getSpeedMode
public static SumoCommand getSpeedMode(String vehID)
Returns the speed mode of a vehicle.- Parameters:
vehID
- id of the vehicle- Returns:
- speed mode
-
getSpeedWithoutTraCI
public static SumoCommand getSpeedWithoutTraCI(String vehID)
getSpeedWithoutTraCI.- Parameters:
vehID
- id of the vehicle- Returns:
- speed in m/s
-
getStopState
public 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.- Parameters:
vehID
- id of the vehicle- Returns:
- speed in m/s
-
getTau
public static SumoCommand getTau(String vehID)
getTau.- Parameters:
vehID
- id of the vehicle- Returns:
- tau
-
getVia
public static SumoCommand getVia(String vehID)
Returns the ids of via edges for this vehicle.- Parameters:
vehID
- id of the vehicle- Returns:
- ids of via edges for this vehicle
-
getWaitingTime
public 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. (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
public static SumoCommand getTypeID(String vehID)
Returns the id of the type of the named vehicle.- Parameters:
vehID
- id of the vehicle- Returns:
- type id
-
getPersonIDList
public 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.- Parameters:
vehID
- id of the vehicle- Returns:
- vehicle class
-
getVehicleClass
public static SumoCommand getVehicleClass(String vehID)
Returns the vehicle class.- Parameters:
vehID
- id of the vehicle- Returns:
- vehicle class
-
getAccumulatedWaitingTime
public static SumoCommand getAccumulatedWaitingTime(String vehID)
Returns the vehicle class.- Parameters:
vehID
- id of the vehicle- Returns:
- vehicle class
-
getWidth
public static SumoCommand getWidth(String vehID)
Returns the vehicle's width (in m).- Parameters:
vehID
- id of the vehicle- Returns:
- width
-
isStopped
public static SumoCommand isStopped(String vehID)
isStopped.- Parameters:
vehID
- id of the vehicle- Returns:
- stop
-
isStoppedTriggered
public static SumoCommand isStoppedTriggered(String vehID)
Return whether the vehicle is stopped and waiting for a person or container.- Parameters:
vehID
- id of the vehicle- Returns:
- stop
-
isAtContainerStop
public static SumoCommand isAtContainerStop(String vehID)
Return whether the vehicle is stopped at a container stop.- Parameters:
vehID
- id of the vehicle- Returns:
- stop
-
isStoppedParking
public static SumoCommand isStoppedParking(String vehID)
isStoppedParking.- Parameters:
vehID
- id of the vehicle- Returns:
- stop
-
isAtBusStop
public static SumoCommand isAtBusStop(String vehID)
isAtBusStop.- Parameters:
vehID
- id of the vehicle- Returns:
- stop
-
isRouteValid
public static SumoCommand isRouteValid(String vehID)
Returns whether the Route is valid.- Parameters:
vehID
- id of the vehicle- Returns:
- route valid
-
slowDown
public static SumoCommand slowDown(String vehID, double speed, double duration)
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
public 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.- Parameters:
vehID
- vehicle idlaneIndex
- lane indexduration
- duration- Returns:
- SumoCommand
-
changeTarget
public static SumoCommand changeTarget(String vehID, String edgeID)
The vehicle's destination edge is set to the given. The route is rebuilt.- Parameters:
vehID
- vehicle idedgeID
- edge id- Returns:
- SumoCommand
-
changeSublane
public 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.- Parameters:
vehID
- vehicle idlatDist
- latDist- Returns:
- SumoCommand
-
moveTo
public static SumoCommand moveTo(String vehID, String laneID, double pos)
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
public static SumoCommand remove(String vehID, byte reason)
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
public static SumoCommand rerouteEffort(String vehID)
Computes a new route using the vehicle's internal and the global edge effort information.- Parameters:
vehID
- id of the vehicle- Returns:
- SumoCommand
-
rerouteTraveltime
public static SumoCommand rerouteTraveltime(String vehID)
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
public static SumoCommand setAccel(String vehID, double accel)
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
public static SumoCommand setLateralAlignment(String vehID, String align)
Sets the preferred lateral alignment for this vehicle.- Parameters:
vehID
- id of the vehiclealign
- align- Returns:
- SumoCommand
-
setApparentDecel
public static SumoCommand setApparentDecel(String vehID, double decel)
Sets the apparent deceleration in m/s^2 for this vehicle.- Parameters:
vehID
- id of the vehicledecel
- decel- Returns:
- SumoCommand
-
setMinGapLat
public static SumoCommand setMinGapLat(String vehID, double minGapLat)
Sets the minimum lateral gap of the vehicle at 50km/h in m.- Parameters:
vehID
- id of the vehicleminGapLat
- minGapLat- Returns:
- SumoCommand
-
setColor
public static SumoCommand setColor(String vehID, SumoColor color)
Sets the vehicle's color (RGBA).- Parameters:
vehID
- id of the vehiclecolor
- color- Returns:
- SumoCommand
-
setDecel
public static SumoCommand setDecel(String vehID, double decel)
Sets the deceleration of the named vehicle.- Parameters:
vehID
- id of the vehicledecel
- deceleration- Returns:
- SumoCommand
-
setHeight
public static SumoCommand setHeight(String vehID, double height)
Sets the height in m for this vehicle.- Parameters:
vehID
- id of the vehicleheight
- in m- Returns:
- SumoCommand
-
setLaneChangeMode
public static SumoCommand setLaneChangeMode(String vehID, int lcm)
Sets the vehicle's lane change mode as a bitset.- Parameters:
vehID
- id of the vehiclelcm
- lane change model- Returns:
- SumoCommand
-
setEmergencyDecel
public static SumoCommand setEmergencyDecel(String vehID, double decel)
Sets the maximal physically possible deceleration in m/s^2 for this vehicle.- Parameters:
vehID
- id of the vehicledecel
- decel- Returns:
- SumoCommand
-
setRoute
public static SumoCommand setRoute(String vehID, SumoStringList edgeList)
Sets the IDs of the edges the vehicle's route is made of.- Parameters:
vehID
- id of the vehicleedgeList
- edges list- Returns:
- SumoCommand
-
setRoutingMode
public 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.rerouting- Parameters:
vehID
- id of the vehicleroutingMode
- routingMode- Returns:
- SumoCommand
-
setType
public static SumoCommand setType(String vehID, String typeID)
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
public static SumoCommand setEmissionClass(String vehID, String clazz)
Sets the emission class of the named vehicle.- Parameters:
vehID
- id of the vehicleclazz
- emission class- Returns:
- SumoCommand
-
setImperfection
public static SumoCommand setImperfection(String vehID, double imperfection)
setImperfection.- Parameters:
vehID
- vehicle idimperfection
- imperfection- Returns:
- SumoCommand
-
setLength
public static SumoCommand setLength(String vehID, double length)
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
public static SumoCommand setLine(String vehID, String line)
Sets the line information for this vehicle.- Parameters:
vehID
- vehicle idline
- line- Returns:
- SumoCommand
-
setVia
public static SumoCommand setVia(String vehID, SumoStringList edgeList)
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
public static SumoCommand setMaxSpeed(String vehID, double speed)
Sets the maximum speed (in m/s) of the named vehicle.- Parameters:
vehID
- vehicle idspeed
- speed- Returns:
- SumoCommand
-
setMaxSpeedLat
public static SumoCommand setMaxSpeedLat(String vehID, double speed)
Sets the maximum lateral speed in m/s for this vehicle.- Parameters:
vehID
- vehicle idspeed
- speed- Returns:
- SumoCommand
-
setMinGap
public static SumoCommand setMinGap(String vehID, double minGap)
Sets the minimum gap (in m) between this vehicle and the vehicle before it.- Parameters:
vehID
- vehicle idminGap
- minimum gap- Returns:
- SumoCommand
-
setRouteID
public static SumoCommand setRouteID(String vehID, String routeID)
Sets the id of the route of the named vehicle.- Parameters:
vehID
- vehicle idrouteID
- route id- Returns:
- SumoCommand
-
setShapeClass
public static SumoCommand setShapeClass(String vehID, String clazz)
setShapeClass.- Parameters:
vehID
- vehicle idclazz
- shape class- Returns:
- SumoCommand
-
setSignals
public static SumoCommand setSignals(String vehID, int signals)
setSignals.- Parameters:
vehID
- vehicle idsignals
- signals- Returns:
- SumoCommand
-
setSpeed
public static SumoCommand setSpeed(String vehID, double speed)
Sets the speed (in m/s) of the named vehicle.- Parameters:
vehID
- vehicle idspeed
- speed- Returns:
- SumoCommand
-
setSpeedDeviation
public static SumoCommand setSpeedDeviation(String vehID, double deviation)
Sets the standard deviation of the estimated maximum speed.- Parameters:
vehID
- vehicle iddeviation
- deviation- Returns:
- SumoCommand
-
setSpeedFactor
public 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.- Parameters:
vehID
- vehicle idfactor
- factor- Returns:
- SumoCommand
-
setSpeedMode
public static SumoCommand setSpeedMode(String vehID, int sm)
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
public static SumoCommand setBusStop(String vehID, String stopID, double duration, double until)
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
public static SumoCommand resume(String vehID)
Continue after a stop.- Parameters:
vehID
- vehicle id- Returns:
- SumoCommand
-
setTau
public static SumoCommand setTau(String vehID, double tau)
setTau.- Parameters:
vehID
- vehicle idtau
- tau- Returns:
- SumoCommand
-
setVehicleClass
public static SumoCommand setVehicleClass(String vehID, String clazz)
Sets the vehicle class.- Parameters:
vehID
- vehicle idclazz
- vehicle class- Returns:
- SumoCommand
-
setWidth
public static SumoCommand setWidth(String vehID, double width)
Sets the vehicle's width (in m).- Parameters:
vehID
- vehicle idwidth
- width- Returns:
- SumoCommand
-
updateBestLanes
public 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. 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
public 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.- Parameters:
vehID
- vehicle idparkingAreaID
- parkingAreaID- Returns:
- SumoCommand
-
-