177 void passTime(
SUMOTime dt,
bool waiting);
186 return myWaitingIntervals;
199 void appendWaitingTime(
SUMOTime dt);
917 const std::vector<MSTransportable*>&
getPersons()
const;
1053 const bool parking,
const bool triggered,
const bool containerTriggered, std::string& errorMsg);
1067 const bool triggered,
const bool containerTriggered,
const bool isContainerStop, std::string& errorMsg);
1084 std::vector<SUMOReal>& furtherLanesPosLat,
1085 const std::vector<MSLane*>& passedLanes);
1118 void setSpeedTimeLine(
const std::vector<std::pair<SUMOTime, SUMOReal> >& speedTimeLine);
1124 void setLaneTimeLine(
const std::vector<std::pair<SUMOTime, int> >& laneTimeLine);
1127 int getSpeedMode()
const;
1162 void setConsiderSafeVelocity(
bool value);
1168 void setConsiderMaxAcceleration(
bool value);
1174 void setConsiderMaxDeceleration(
bool value);
1180 void setRespectJunctionPriority(
bool value);
1187 return myRespectJunctionPriority;
1194 void setEmergencyBrakeRedLight(
bool value);
1201 return myEmergencyBrakeRedLight;
1208 void setLaneChangeMode(
int value);
1215 return myOriginalSpeed;
1221 return myLastVTDAccess;
1232 bool isVTDControlled()
const;
1234 bool isVTDAffected(
SUMOTime t)
const;
1452 myLink(link), myVLinkPass(vPass), myVLinkWait(vWait), mySetRequest(setRequest),
1453 myArrivalTime(arrivalTime), myArrivalSpeed(arrivalSpeed),
1454 myArrivalTimeBraking(arrivalTimeBraking), myArrivalSpeedBraking(arrivalSpeedBraking),
1455 myDistance(distance),
1456 accelV(leaveSpeed), hadVehicle(false), availableSpace(-1.) {
1464 myLink(0), myVLinkPass(vWait), myVLinkWait(vWait), mySetRequest(false),
1465 myArrivalTime(0), myArrivalSpeed(0),
1466 myArrivalTimeBraking(0), myArrivalSpeedBraking(0),
1467 myDistance(distance),
1468 accelV(-1), hadVehicle(false), availableSpace(-1.) {
1477 accelV =
MIN2(accelV, v);
1481 return accelV < 0 ? myVLinkPass : accelV;
1514 (
SUMOReal)sqrt(2 * dist * accel + v * v));
1529 void adaptToLeader(
const std::pair<const MSVehicle*, SUMOReal> leaderInfo,
1532 SUMOReal distToCrossing = -1)
const;
bool signalSet(int which) const
Returns whether the given signal is on.
void setAngle(SUMOReal angle)
Set a custom vehicle angle in rad.
const MSLane * myLastBestLanesInternalLane
bool isRemoteControlled() const
Returns the information whether the vehicle is fully controlled via TraCI.
const MSVehicleType * myType
This Vehicle's type.
void replaceVehicleType(MSVehicleType *type)
Replaces the current vehicle type by the one given.
bool enterLaneAtMove(MSLane *enteredLane, bool onTeleporting=false)
Update when the vehicle enters a new lane in the move step.
static int nextLinkPriority(const std::vector< MSLane * > &conts)
get a numerical value for the priority of the upcoming link
std::list< std::pair< SUMOTime, SUMOTime > > waitingIntervalList
Representation of a vehicle in the micro simulation.
void planMove(const SUMOTime t, const MSLeaderInfo &ahead, const SUMOReal lengthsInFront)
Compute safe velocities for the upcoming lanes based on positions and speeds from the last time step...
SUMOReal speed() const
Speed of this state.
SUMOTime timeToBoardNextPerson
The time at which the vehicle is able to board another person.
MSEdgeWeightsStorage * myEdgeWeights
SUMOReal backPos() const
back Position of this state
const MSEdge * myLastBestLanesEdge
LaneChangeMode
modes for resolving conflicts between external control (traci) and vehicle control over lane changing...
MSAbstractLaneChangeModel * myLaneChangeModel
bool myAmOnNet
Whether the vehicle is on the network (not parking, teleported, vaporized, or arrived) ...
LaneChangeMode myRightDriveLC
changing to the rightmost lane
std::vector< std::vector< LaneQ > > myBestLanes
const MSCFModel & getCarFollowModel() const
Returns the vehicle's car following model definition.
std::vector< MSLane * > myFurtherLanes
The information into which lanes the vehicle laps into.
State myState
This Vehicles driving state (pos and speed)
void setTentativeLaneAndPosition(MSLane *lane, SUMOReal pos, SUMOReal posLat=0)
set tentative lane and position during insertion to ensure that all cfmodels work (some of them requi...
SUMOReal getRightSideOnEdge(const MSLane *lane=0) const
Get the vehicle's lateral position on the edge of the given lane (or its current edge if lane == 0) ...
A lane area vehicles can halt at.
SUMOReal getMaxSpeed() const
Returns the maximum speed.
DriveItemVector myLFLinkLanes
SUMOReal pos() const
Position of this state.
void enterLaneAtInsertion(MSLane *enteredLane, SUMOReal pos, SUMOReal speed, SUMOReal posLat, MSMoveReminder::Notification notification)
Update when the vehicle enters a new lane in the emit step.
bool resumeFromStopping()
bool myAmRegisteredAsWaitingForPerson
Whether this vehicle is registered as waiting for a person (for deadlock-recognition) ...
bool hasInfluencer() const
SUMOReal getLengthWithGap() const
Get vehicle's length including the minimum gap [m].
int bestLaneOffset
The (signed) number of lanes to be crossed to get to the lane which allows to continue the drive...
void setBlinkerInformation()
void addContainer(MSTransportable *container)
Adds a container.
SUMOReal getLeaveSpeed() const
virtual void drawOutsideNetwork(bool) const
register vehicle for drawing while outside the network
bool unsafeLinkAhead(const MSLane *lane) const
whether the vehicle may safely move to the given lane with regard to upcoming links ...
SUMOReal myAcceleration
The current acceleration after dawdling in m/s.
SUMOReal getSpeedWithoutTraciInfluence() const
Returns the uninfluenced velocity.
SUMOTime getWaitingTime() const
Returns the SUMOTime waited (speed was lesser than 0.1m/s)
The front lights are on (no visualisation)
Signalling
Some boolean values which describe the state of some vehicle parts.
Position getPosition(const SUMOReal offset=0) const
Return current position (x/y, cartesian)
The base class for an intersection.
bool hasArrived() const
Returns whether this vehicle has already arived (reached the arrivalPosition on its final edge) ...
The car-following model abstraction.
bool myConsiderMaxAcceleration
Whether the maximum acceleration shall be regarded.
The high beam lights are on (no visualisation)
Notification
Definition of a vehicle state.
MSDevice_Transportable * myPersonDevice
The passengers this vehicle may have.
SUMOReal currentLength
The length which may be driven on this lane.
bool replaceRoute(const MSRoute *route, bool onInit=false, int offset=0)
Replaces the current route by the given one.
Changes the wished vehicle speed / lanes.
SUMOReal getHCEmissions() const
Returns HC emission of the current state.
bool myRespectJunctionPriority
Whether the junction priority rules are respected.
bool reached
Information whether the stop has been reached.
const MSLane * getBackLane() const
State & operator=(const State &state)
Assignment operator.
The backwards driving lights are on (no visualisation)
vehicle doesn't want to change
TraciLaneChangePriority
modes for prioritizing traci lane change requests
SUMOReal estimateLeaveSpeed(const MSLink *const link, const SUMOReal vLinkPass) const
estimate leaving speed when accelerating across a link
WaitingTimeCollector myWaitingTimeCollector
SUMOReal mySpeed
the stored speed
Definition of vehicle stop (position and duration)
SUMOReal getCO2Emissions() const
Returns CO2 emission of the current state.
bool executeMove()
Executes planned vehicle movements with regards to right-of-way.
std::vector< const MSEdge * > ConstMSEdgeVector
SUMOTime myMemorySize
the maximal memory to store
std::pair< const MSVehicle *const, SUMOReal > getLeader(SUMOReal dist=0) const
Returns the leader of the vehicle looking for a fixed distance.
SUMOReal getPositionOnLane() const
Get the vehicle's position along the lane.
DriveProcessItem(MSLink *link, SUMOReal vPass, SUMOReal vWait, bool setRequest, SUMOTime arrivalTime, SUMOReal arrivalSpeed, SUMOTime arrivalTimeBraking, SUMOReal arrivalSpeedBraking, SUMOReal distance, SUMOReal leaveSpeed=-1.)
The base class for microscopic and mesoscopic vehicles.
bool myHaveToWaitOnNextLink
void adaptToLeaders(const MSLeaderInfo &ahead, SUMOReal latOffset, const SUMOReal seen, DriveProcessItem *const lastLink, const MSLane *const lane, SUMOReal &v, SUMOReal &vLinkPass) const
SUMOReal processNextStop(SUMOReal currentVelocity)
Processes stops, returns the velocity needed to reach the stop.
A storage for edge travel times and efforts.
bool hasStops() const
Returns whether the vehicle has to stop somewhere.
SUMOReal length
The overall length which may be driven when using this lane without a lane change.
void enterLaneAtLaneChange(MSLane *enteredLane)
Update when the vehicle enters a new lane in the laneChange step.
SUMOReal myStopDist
distance to the next stop or -1 if there is none
The car-following model and parameter.
SUMOReal updateFurtherLanes(std::vector< MSLane * > &furtherLanes, std::vector< SUMOReal > &furtherLanesPosLat, const std::vector< MSLane * > &passedLanes)
update a vector of further lanes and return the new backPos
bool triggered
whether an arriving person lets the vehicle continue
MSAbstractLaneChangeModel & getLaneChangeModel()
MSCFModel::VehicleVariables * myCFVariables
The per vehicle variables of the car following model.
const MSCFModel & getCarFollowModel() const
Returns the vehicle type's car following model definition (const version)
Performs lane changing of vehicles.
Right blinker lights are switched on.
MSChargingStation * chargingStation
(Optional) charging station if one is assigned to the stop
SUMOReal nextOccupation
As occupation, but without the first lane.
SUMOReal getLateralPositionOnLane() const
Get the vehicle's lateral position on the lane.
SUMOReal getElectricityConsumption() const
Returns electricity consumption of the current state.
SUMOTime getMemorySize() const
std::vector< std::pair< SUMOTime, int > > myLaneTimeLine
The lane usage time line to apply.
int getContainerNumber() const
Returns the number of containers.
bool operator!=(const State &state)
Operator !=.
static std::vector< MSTransportable * > myEmptyTransportableVector
Performs lane changing of vehicles.
A road/street connecting two junctions.
MSLane * lane
The described lane.
void checkRewindLinkLanes(const SUMOReal lengthsInFront, DriveItemVector &lfLinks) const
Left blinker lights are switched on.
SUMOReal computeAngle() const
compute the current vehicle angle
DriveProcessItem(SUMOReal vWait, SUMOReal distance)
constructor if the link shall not be passed
SUMOReal getLateralOverlap() const
return the amount by which the vehicle extends laterally outside it's primary lane ...
void workOnMoveReminders(SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed)
Processes active move reminder.
vehicle want's to change to right lane
void removeApproachingInformation(DriveItemVector &lfLinks) const
unregister approach from all upcoming links
MSStoppingPlace * containerstop
(Optional) container stop if one is assigned to the stop
Stores the waiting intervals over the previous seconds (memory is to be specified in ms...
PositionVector getBoundingBox() const
get bounding rectangle
Encapsulated SAX-Attributes.
ChangeRequest
Requests set via TraCI.
const std::vector< MSLane * > & getBestLanesContinuation() const
Returns the subpart of best lanes that describes the vehicle's current lane and their successors...
A point in 2D or 3D with translation and scaling methods.
bool willPass(const MSEdge *const edge) const
Returns whether the vehicle wil pass the given edge.
SUMOReal myAngle
the angle (
void updateBestLanes(bool forceRebuild=false, const MSLane *startLane=0)
computes the best lanes to use in order to continue the route
SUMOTime timeToLoadNextContainer
The time at which the vehicle is able to load another container.
Position myCachedPosition
const MSLane * lane
The lane to stop at.
SUMOReal myOriginalSpeed
The velocity before influence.
std::vector< SUMOReal > myFurtherLanesPosLat
bool addStop(const SUMOVehicleParameter::Stop &stopPar, std::string &errorMsg, SUMOTime untilOffset=0)
Adds a stop.
std::list< Stop > myStops
The vehicle's list of stops.
ConstMSEdgeVector::const_iterator MSRouteIterator
PositionVector getBoundingPoly() const
get bounding polygon
bool isStopped() const
Returns whether the vehicle is at a stop.
bool isStoppedInRange(SUMOReal pos) const
return whether the given position is within range of the current stop
bool myConsiderMaxDeceleration
Whether the maximum deceleration shall be regarded.
void adaptLeaveSpeed(const SUMOReal v)
MSLane * myLane
The lane the vehicle is on.
bool getRespectJunctionPriority() const
Returns whether junction priority rules shall be respected.
bool myAmRegisteredAsWaitingForContainer
Whether this vehicle is registered as waiting for a container (for deadlock-recognition) ...
Blinker lights on both sides are switched on.
Influencer * myInfluencer
An instance of a velocity/lane influencing instance; built in "getInfluencer".
void resetRoutePosition(int index)
std::vector< LaneQ >::iterator myCurrentLaneInBestLanes
const std::vector< MSTransportable * > & getContainers() const
retrieve riding containers
SUMOReal getDistanceToPosition(SUMOReal destPos, const MSEdge *destEdge) const
SUMOReal getSafeFollowSpeed(const std::pair< const MSVehicle *, SUMOReal > leaderInfo, const SUMOReal seen, const MSLane *const lane, SUMOReal distToCrossing) const
compute safe speed for following the given leader
SUMOReal getSpaceTillLastStanding(const MSLane *l, bool &foundStopped) const
SUMOTime duration
The stopping duration.
SUMOReal getAccumulatedWaitingSeconds() const
Returns the number of seconds waited (speed was lesser than 0.1m/s) within the last millisecs...
SUMOReal estimateSpeedAfterDistance(const SUMOReal dist, const SUMOReal v, const SUMOReal accel) const
A blue emergency light is on.
A structure representing the best lanes for continuing the route.
void loadState(const SUMOSAXAttributes &attrs, const SUMOTime offset)
Loads the state of this vehicle from the given description.
Everything is switched off.
void onRemovalFromNet(const MSMoveReminder::Notification reason)
Called when the vehicle is removed from the network.
std::set< std::string > awaitedContainers
IDs of containers the vehicle has to wait for until departing.
Something on a lane to be noticed about vehicle movement.
void fixPosition()
repair errors in vehicle position after changing between internal edges
SUMOTime myWaitingTime
The time the vehicle waits (is not faster than 0.1m/s) in seconds.
One of the left doors is opened.
LaneChangeMode mySpeedGainLC
lane changing to travel with higher speed
void planMoveInternal(const SUMOTime t, MSLeaderInfo ahead, DriveItemVector &lfLinks, SUMOReal &myStopDist) const
bool isParking() const
Returns whether the vehicle is parking.
LaneChangeMode myCooperativeLC
lane changing with the intent to help other vehicles
const std::vector< LaneQ > & getBestLanes() const
Returns the description of best lanes to use in order to continue the route.
int getRoutePosition() const
bool knowsEdgeTest(MSEdge &edge) const
State(SUMOReal pos, SUMOReal speed, SUMOReal posLat, SUMOReal backPos)
Constructor.
int getPersonNumber() const
Returns the number of persons.
bool allowsContinuation
Whether this lane allows to continue the drive.
SUMOReal getHarmonoise_NoiseEmissions() const
Returns noise emissions of the current state.
const std::vector< MSTransportable * > & getPersons() const
retrieve riding persons
Container that holds the vehicles driving state (position+speed).
void saveState(OutputDevice &out)
Saves the states of a vehicle.
SUMOReal getLength() const
Returns the length of this link.
SUMOReal getOriginalSpeed() const
Returns the originally longitudinal speed to use.
MSCFModel::VehicleVariables * getCarFollowVariables() const
Returns the vehicle's car following model variables.
SUMOReal getNOxEmissions() const
Returns NOx emission of the current state.
SUMOReal getRightSideOnLane() const
Get the vehicle's lateral position on the lane:
bool myEmergencyBrakeRedLight
Whether red lights are a reason to brake.
MSEdgeWeightsStorage & _getWeightsStorage() const
ConstMSEdgeVector myVTDRoute
void leaveLane(const MSMoveReminder::Notification reason)
Update of members if vehicle leaves a new lane in the lane change step or at arrival.
SUMOReal getMaxAccel() const
Get the vehicle type's maximum acceleration [m/s^2].
SUMOReal getPMxEmissions() const
Returns PMx emission of the current state.
SUMOReal getCOEmissions() const
Returns CO emission of the current state.
Abstract in-vehicle device.
void updateOccupancyAndCurrentBestLane(const MSLane *startLane)
updates LaneQ::nextOccupation and myCurrentLaneInBestLanes
const std::vector< SUMOReal > & getFurtherLanesPosLat() const
void setEmergencyBlueLight(SUMOTime currentTime)
sets the blue flashing light for emergency vehicles
SUMOReal getLatOffset(const MSLane *lane) const
Get the offset that that must be added to interpret myState.myPosLat for the given lane...
vehicle want's to change to left lane
const std::vector< MSLane * > & getFurtherLanes() const
Influencer & getInfluencer()
Returns the velocity/lane influencer.
Structure representing possible vehicle parameter.
bool getEmergencyBrakeRedLight() const
Returns whether red lights shall be a reason to brake.
LaneChangeMode mySublaneLC
changing to the prefered lateral alignment
SUMOTime getAccumulatedWaitingTime(SUMOTime t=MSGlobals::gWaitingTimeMemory) const
Returns the SUMOTime waited (speed was lesser than 0.1m/s) within the last t millisecs.
std::vector< std::pair< SUMOTime, SUMOReal > > mySpeedTimeLine
The velocity time line to apply.
SUMOReal getSlope() const
Returns the slope of the road at vehicle's position.
bool containerTriggered
whether an arriving container lets the vehicle continue
void setVTDState(Position xyPos)
sets position outside the road network
SUMOTime getLastAccessTimeStep() const
SUMOReal occupation
The overall vehicle sum on consecutive lanes which can be passed without a lane change.
MSLane * getViaLaneOrLane() const
return the via lane if it exists and the lane otherwise
SUMOReal getAcceleration() const
Returns the vehicle's acceleration in m/s.
SUMOReal getCenterOnEdge(const MSLane *lane=0) const
Get the vehicle's lateral position on the edge of the given lane (or its current edge if lane == 0) ...
int mySignals
State of things of the vehicle that can be on or off.
std::vector< MSLane * > bestContinuations
Consecutive lane that can be followed without a lane change (contribute to length and occupation) ...
Definition of vehicle stop (position and duration)
SUMOReal myArrivalSpeedBraking
std::set< std::string > awaitedPersons
IDs of persons the vehicle has to wait for until departing.
SUMOReal getFuelConsumption() const
Returns fuel consumption of the current state.
void adaptToLeader(const std::pair< const MSVehicle *, SUMOReal > leaderInfo, const SUMOReal seen, DriveProcessItem *const lastLink, const MSLane *const lane, SUMOReal &v, SUMOReal &vLinkPass, SUMOReal distToCrossing=-1) const
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
SUMOTime until
The time at which the vehicle may continue its journey.
const ConstMSEdgeVector getStopEdges() const
Returns the list of still pending stop edges.
friend class MSVehicle
vehicle sets states directly
MSRouteIterator edge
The edge in the route to stop at.
const waitingIntervalList & getWaitingIntervals() const
bool addTraciBusOrContainerStop(const std::string &stopId, const SUMOTime duration, const SUMOTime until, const bool parking, const bool triggered, const bool containerTriggered, const bool isContainerStop, std::string &errorMsg)
SUMOReal getSpeed() const
Returns the vehicle's current speed.
bool isFrontOnLane(const MSLane *lane) const
Returns the information whether the front of the vehicle is on the given lane.
SUMOReal myPos
the stored position
SUMOReal getWaitingSeconds() const
Returns the number of seconds waited (speed was lesser than 0.1m/s)
bool isStoppedTriggered() const
Returns whether the vehicle is on a triggered stop.
waitingIntervalList myWaitingIntervals
static SUMOTime gWaitingTimeMemory
length of memory for waiting times (in millisecs)
std::vector< DriveProcessItem > DriveItemVector
Container for used Links/visited Lanes during lookForward.
SUMOReal nextStopDist() const
return the distance to the next stop or SUMORealMax if there is none.
SUMOReal endPos
The stopping position end.
const MSEdge * getRerouteOrigin() const
Returns the starting point for reroutes (usually the current edge)
vehicle want's to keep the current lane
int getSignals() const
Returns the signals.
Static storage of an output device and its base (abstract) implementation.
SUMOReal myPosLat
the stored lateral position
void switchOffSignal(int signal)
Switches the given signal off.
void switchOnSignal(int signal)
Switches the given signal on.
void addPerson(MSTransportable *person)
Adds a passenger.
static std::vector< MSLane * > myEmptyLaneVector
void adaptBestLanesOccupation(int laneIndex, SUMOReal density)
update occupation from MSLaneChanger
static bool overlap(const MSVehicle *veh1, const MSVehicle *veh2)
SUMOReal myBackPos
the stored back position
SUMOTime cumulatedWaitingTime(SUMOTime memory=-1) const
virtual ~MSVehicle()
Destructor.
SUMOReal getVehicleMaxSpeed(const SUMOVehicle *const veh) const
Returns the lane's maximum speed, given a vehicle's speed limit adaptation.
bool isOnRoad() const
Returns the information whether the vehicle is on a road (is simulated)
bool mySpeedAdaptationStarted
Whether influencing the speed has already started.
MSLane * getLane() const
Returns the lane the vehicle is on.
int influenceChangeDecision(int state)
allow TraCI to influence a lane change decision
void activateReminders(const MSMoveReminder::Notification reason)
"Activates" all current move reminder
SUMOReal getTimeGap() const
Returns the time gap in seconds to the leader of the vehicle looking for a fixed distance.
SUMOReal getBackPositionOnLane() const
Get the vehicle's position relative to its current lane.
bool addTraciStop(MSLane *const lane, const SUMOReal startPos, const SUMOReal endPos, const SUMOTime duration, const SUMOTime until, const bool parking, const bool triggered, const bool containerTriggered, std::string &errorMsg)
SUMOReal startPos
The stopping position start.
A red emergency light is on.
MSStoppingPlace * busstop
(Optional) bus stop if one is assigned to the stop
Representation of a lane in the micro simulation.
const MSEdgeWeightsStorage & getWeightsStorage() const
Returns the vehicle's internal edge travel times/efforts container.
void adaptLaneEntering2MoveReminder(const MSLane &enteredLane)
Adapts the vehicle's entering of a new lane.
SUMOTime myArrivalTimeBraking
One of the right doors is opened.
Interface for lane-change models.
int getBestLaneOffset() const
returns the current offset from the best lane
SUMOReal posLat() const
Lateral Position of this state (m relative to the centerline of the lane).
bool myConsiderSafeVelocity
Whether the safe velocity shall be regarded.
MSDevice_Transportable * myContainerDevice
The containers this vehicle may have.
The fog lights are on (no visualisation)
bool parking
whether the vehicle is removed from the net while stopping
SUMOReal getAngle() const
Returns the vehicle's direction in degrees.
A yellow emergency light is on.
const Position getBackPosition() const