 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
49 #define INVALID_SPEED 299792458 + 1 // nothing can go faster than the speed of light! Refs. #2577
277 bool replaceRoute(
const MSRoute* route,
const std::string& info,
bool onInit =
false,
int offset = 0,
bool addStops =
true,
bool removeStops =
true);
698 void setAngle(
double angle,
bool straightenFurther =
false);
1091 std::pair<const MSVehicle* const, double>
getLeader(
double dist = 0)
const;
1300 const bool parking,
const bool triggered,
const bool containerTriggered, std::string& errorMsg);
1314 const bool triggered,
const bool containerTriggered,
const SumoXMLTag stoppingPlaceType, std::string& errorMsg);
1337 std::vector<double>& furtherLanesPosLat,
1338 const std::vector<MSLane*>& passedLanes);
1417 static std::map<const MSVehicle*, GapControlState*>
refVehMap;
1437 void setSpeedTimeLine(
const std::vector<std::pair<SUMOTime, double> >& speedTimeLine);
1441 void activateGapController(
double originalTau,
double newTimeHeadway,
double newSpaceHeadway,
double duration,
double changeRate,
double maxDecel,
MSVehicle* refVeh =
nullptr);
1450 void setLaneTimeLine(
const std::vector<std::pair<SUMOTime, int> >& laneTimeLine);
1695 const double seen,
const MSLane*
const lane,
double distToCrossing)
const;
1761 void processLaneAdvances(std::vector<MSLane*>& passedLanes,
bool& moved, std::string& emergencyReason);
1933 SUMOTime arrivalTime,
double arrivalSpeed,
1934 SUMOTime arrivalTimeBraking,
double arrivalSpeedBraking,
1936 double leaveSpeed = -1.) :
2018 void adaptToLeader(
const std::pair<const MSVehicle*, double> leaderInfo,
2019 const double seen, DriveProcessItem*
const lastLink,
2020 const MSLane*
const lane,
double& v,
double& vLinkPass,
2021 double distToCrossing = -1)
const;
2034 const double seen, DriveProcessItem*
const lastLink,
2035 const MSLane*
const lane,
double& v,
double& vLinkPass)
const;
2039 DriveProcessItem*
const lastLink,
double& v,
double& vLinkPass,
double& vLinkWait,
bool& setRequest,
2040 bool isShadowLink =
false)
const;
2044 DriveProcessItem*
const lastLink,
double& v,
double& vLinkPass,
double& vLinkWait,
bool& setRequest)
const;
double remainingDuration
Remaining duration for keeping the target headway.
The car-following model and parameter.
double processNextStop(double currentVelocity)
Processes stops, returns the velocity needed to reach the stop.
static void cleanup()
Static cleanup.
Everything is switched off.
void updateBestLanes(bool forceRebuild=false, const MSLane *startLane=0)
computes the best lanes to use in order to continue the route
SUMOTime lastUpdate
Time of the last update of the gap control.
vehicle want's to change to right lane
double 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)
double getSpeedWithoutTraciInfluence() const
Returns the uninfluenced velocity.
SUMOTime collisionStopTime() const
Returns the remaining time a vehicle needs to stop due to a collision. A negative value indicates tha...
Left blinker lights are switched on.
int bestLaneOffset
The (signed) number of lanes to be crossed to get to the lane which allows to continue the drive.
MSStoppingPlace * busstop
(Optional) bus stop if one is assigned to the stop
Stop(const SUMOVehicleParameter::Stop &par)
int getBestLaneOffset() const
double getPreviousSpeed() const
Returns the vehicle's speed before the previous time step.
SUMOTime getLastAccessTimeStep() const
A red emergency light is on.
A lane area vehicles can halt at.
double getMaxAccel() const
Get the vehicle type's maximum acceleration [m/s^2].
bool haveValidStopEdges() const
check whether all stop.edge MSRouteIterators are valid and in order
bool hasArrived() const
Returns whether this vehicle has already arived (reached the arrivalPosition on its final edge)
int numExpectedPerson
The number of still expected persons.
bool myAmRegisteredAsWaitingForPerson
Whether this vehicle is registered as waiting for a person (for deadlock-recognition)
MSLane * getViaLaneOrLane() const
return the via lane if it exists and the lane otherwise
SUMOTime getActionStepLength() const
Returns this type's default action step length.
A lane area vehicles can halt at.
Changes the wished vehicle speed / lanes.
MSVehicle & operator=(const MSVehicle &)
invalidated assignment operator
std::vector< MSLane * > myFurtherLanes
The information into which lanes the vehicle laps into.
double myStopDist
distance to the next stop or doubleMax if there is none
double influenceSpeed(SUMOTime currentTime, double speed, double vSafe, double vMin, double vMax)
Applies stored velocity information on the speed to use.
bool reached
Information whether the stop has been reached.
std::list< Stop > getMyStops()
const std::vector< LaneQ > & getBestLanes() const
Returns the description of best lanes to use in order to continue the route.
bool enterLaneAtMove(MSLane *enteredLane, bool onTeleporting=false)
Update when the vehicle enters a new lane in the move step.
Representation of a lane in the micro simulation.
bool isStopped() const
Returns whether the vehicle is at a stop.
bool isActive() const
Returns whether the current simulation step is an action point for the vehicle.
bool wasRemoteControlled(SUMOTime lookBack=DELTA_T) const
Returns the information whether the vehicle is fully controlled via TraCI within the lookBack time.
SUMOTime myCollisionImmunity
amount of time for which the vehicle is immune from collisions
MSParkingArea * parkingarea
(Optional) parkingArea if one is assigned to the stop
bool executeMove()
Executes planned vehicle movements with regards to right-of-way.
Performs lane changing of vehicles.
DriveItemVector myLFLinkLanesPrev
planned speeds from the previous step for un-registering from junctions after the new container is fi...
DriveProcessItem(MSLink *link, double vPass, double vWait, bool setRequest, SUMOTime arrivalTime, double arrivalSpeed, SUMOTime arrivalTimeBraking, double arrivalSpeedBraking, double distance, double leaveSpeed=-1.)
bool isOnRoad() const
Returns the information whether the vehicle is on a road (is simulated)
bool isRemoteControlled() const
Returns the information whether the vehicle is fully controlled via TraCI.
SUMOTime duration
The stopping duration.
The base class for an intersection.
Static storage of an output device and its base (abstract) implementation.
LaneChangeMode mySpeedGainLC
lane changing to travel with higher speed
Stop & operator=(const Stop &src)
Invalidated assignment operator.
int mySignals
State of things of the vehicle that can be on or off.
Right blinker lights are switched on.
int influenceChangeDecision(int state)
allow TraCI to influence a lane change decision
void setTentativeLaneAndPosition(MSLane *lane, double pos, double posLat=0)
set tentative lane and position during insertion to ensure that all cfmodels work (some of them requi...
bool hasInfluencer() const
vehicle want's to keep the current lane
ConstMSEdgeVector::const_iterator MSRouteIterator
The fog lights are on (no visualisation)
void passTime(SUMOTime dt, bool waiting)
void updateOccupancyAndCurrentBestLane(const MSLane *startLane)
updates LaneQ::nextOccupation and myCurrentLaneInBestLanes
SUMOTime getAccumulatedWaitingTime() const
Returns the SUMOTime waited (speed was lesser than 0.1m/s) within the last t millisecs.
std::list< std::pair< SUMOTime, SUMOTime > > waitingIntervalList
double getLatOffset(const MSLane *lane) const
Get the offset that that must be added to interpret myState.myPosLat for the given lane.
const MSEdge * myLastBestLanesEdge
bool operator!=(const State &state)
Operator !=.
PositionVector getBoundingBox() const
get bounding rectangle
double length
The overall length which may be driven when using this lane without a lane change.
double myBackPos
the stored back position
Interface for objects listening to vehicle state changes.
double getBrakeGap() const
get distance for coming to a stop (used for rerouting checks)
double getTimeLossSeconds() const
Returns the time loss in seconds.
const Position getBackPosition() const
TraciLaneChangePriority myTraciLaneChangePriority
flags for determining the priority of traci lane change requests
The high beam lights are on (no visualisation)
Provides an interface to an error whose fluctuation is controlled via the driver's 'awareness',...
void setLaneTimeLine(const std::vector< std::pair< SUMOTime, int > > &laneTimeLine)
Sets a new lane timeline.
bool addTraciStopAtStoppingPlace(const std::string &stopId, const SUMOTime duration, const SUMOTime until, const bool parking, const bool triggered, const bool containerTriggered, const SumoXMLTag stoppingPlaceType, std::string &errorMsg)
bool isParking() const
Returns whether the vehicle is parking.
double getBackPositionOnLane() const
Get the vehicle's position relative to its current lane.
double maxDecel
Maximal deceleration to be applied due to the adapted headway.
Container that holds the vehicles driving state (position+speed).
SUMOTime getActionStepLength() const
Returns the vehicle's action step length in millisecs, i.e. the interval between two action points.
bool stopsAt(MSStoppingPlace *stop) const
Returns whether the vehicle stops at the given stopping place.
void addPerson(MSTransportable *person)
Adds a passenger.
A structure representing the best lanes for continuing the current route starting at 'lane'.
vehicle want's to change to left lane
static void init()
Static initalization.
Representation of a vehicle.
double timeHeadwayIncrement
cache storage for the headway increments of the current operation
bool resumeFromStopping()
double mySpeed
the stored speed (should be >=0 at any time)
State(double pos, double speed, double posLat, double backPos)
Constructor.
std::vector< const MSEdge * > ConstMSEdgeVector
double tauCurrent
Current, interpolated value for the desired time headway.
double speed() const
Speed of this state.
bool keepStopping(bool afterProcessing=false) const
Returns whether the vehicle is stopped and must continue to do so.
SUMOTime myMemorySize
the maximal memory to store
void updateActionOffset(const SUMOTime oldActionStepLength, const SUMOTime newActionStepLength)
Process an updated action step length value (only affects the vehicle's action offset,...
void activateGapController(double originalTau, double newTimeHeadway, double newSpaceHeadway, double duration, double changeRate, double maxDecel, MSVehicle *refVeh=nullptr)
Activates the gap control with the given parameters,.
static int nextLinkPriority(const std::vector< MSLane * > &conts)
get a numerical value for the priority of the upcoming link
double myOriginalSpeed
The velocity before influence.
void adaptLaneTimeLine(int indexShift)
Adapts lane timeline when moving to a new lane and the lane index changes.
WaitingTimeCollector myWaitingTimeCollector
void vehicleStateChanged(const SUMOVehicle *const vehicle, MSNet::VehicleState to, const std::string &info="")
Called if a vehicle changes its state.
double getTimeGapOnLane() const
Returns the time gap in seconds to the leader of the vehicle on the same lane.
bool addStop(const SUMOVehicleParameter::Stop &stopPar, std::string &errorMsg, SUMOTime untilOffset=0, bool collision=false, MSRouteIterator *searchStart=0)
Adds a stop.
bool isStoppedOnLane() const
std::string getDescription() const
get a short description for showing in the gui
void onRemovalFromNet(const MSMoveReminder::Notification reason)
Called when the vehicle is removed from the network.
bool considerSafeVelocity() const
Returns whether safe velocities shall be considered.
bool collision
Whether this stop was triggered by a collision.
ConstMSEdgeVector myRemoteRoute
Blinker lights on both sides are switched on.
std::vector< DriveProcessItem > DriveItemVector
Container for used Links/visited Lanes during planMove() and executeMove.
void enterLaneAtInsertion(MSLane *enteredLane, double pos, double speed, double posLat, MSMoveReminder::Notification notification)
Update when the vehicle enters a new lane in the emit step.
LaneChangeMode myStrategicLC
lane changing which is necessary to follow the current route
bool myConsiderMaxAcceleration
Whether the maximum acceleration shall be regarded.
Structure representing possible vehicle parameter.
double myPreviousSpeed
the speed at the begin of the previous time step
bool myHaveToWaitOnNextLink
double getHarmonoise_NoiseEmissions() const
Returns noise emissions of the current state.
bool myConsiderSafeVelocity
Whether the safe velocity shall be regarded.
int myRoutingMode
routing mode (see TraCIConstants.h)
Performs lane changing of vehicles.
DriveItemVector myLFLinkLanes
container for the planned speeds in the current step
bool active
Whether the gap control is active.
MSCFModel::VehicleVariables * getCarFollowVariables() const
Returns the vehicle's car following model variables.
The front lights are on (no visualisation)
double getSafeFollowSpeed(const std::pair< const MSVehicle *, double > leaderInfo, const double seen, const MSLane *const lane, double distToCrossing) const
compute safe speed for following the given leader
const MSCFModel & getCarFollowModel() const
Returns the vehicle's car following model definition.
std::pair< double, LinkDirection > myNextTurn
the upcoming turn for the vehicle
const MSLane * getBackLane() const
double getSlope() const
Returns the slope of the road at vehicle's position.
The ToC Device controls transition of control between automated and manual driving.
Signalling
Some boolean values which describe the state of some vehicle parts.
LaneChangeMode myCooperativeLC
lane changing with the intent to help other vehicles
std::vector< double > myFurtherLanesPosLat
lateral positions on further lanes
SumoXMLTag
Numbers representing SUMO-XML - element names.
bool getEmergencyBrakeRedLight() const
Returns whether red lights shall be a reason to brake.
A storage for edge travel times and efforts.
void planMoveInternal(const SUMOTime t, MSLeaderInfo ahead, DriveItemVector &lfLinks, double &myStopDist, std::pair< double, LinkDirection > &myNextTurn) const
const double SUMO_const_haltingSpeed
the speed threshold at which vehicles are considered as halting
void removeApproachingInformation(const DriveItemVector &lfLinks) const
unregister approach from all upcoming links
Something on a lane to be noticed about vehicle movement.
double getOriginalSpeed() const
Returns the originally longitudinal speed to use.
SUMOTime timeToBoardNextPerson
The time at which the vehicle is able to board another person.
DriveProcessItem(double vWait, double distance, double _availableSpace=0)
constructor if the link shall not be passed
double getLateralPositionOnLane() const
Get the vehicle's lateral position on the lane.
void adaptLaneEntering2MoveReminder(const MSLane &enteredLane)
Adapts the vehicle's entering of a new lane.
vehicle doesn't want to change
void saveState(OutputDevice &out)
Saves the states of a vehicle.
void removePassedDriveItems()
Erase passed drive items from myLFLinkLanes (and unregister approaching information for corresponding...
void planMove(const SUMOTime t, const MSLeaderInfo &ahead, const double lengthsInFront)
Compute safe velocities for the upcoming lanes based on positions and speeds from the last time step....
SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterTT() const
LaneChangeMode
modes for resolving conflicts between external control (traci) and vehicle control over lane changing...
void write(OutputDevice &dev) const
Write the current stop configuration (used for state saving)
SUMOTime myArrivalTimeBraking
void switchOffSignal(int signal)
Switches the given signal off.
void switchOnSignal(int signal)
Switches the given signal on.
void fixPosition()
repair errors in vehicle position after changing between internal edges
Position getPosition(const double offset=0) const
Return current position (x/y, cartesian)
const waitingIntervalList & getWaitingIntervals() const
const std::pair< double, LinkDirection > & getNextTurn()
Get the distance and direction of the next upcoming turn for the vehicle (within its look-ahead range...
void addContainer(MSTransportable *container)
Adds a container.
int getSpeedMode() const
return the current speed mode
void leaveLane(const MSMoveReminder::Notification reason, const MSLane *approachedLane=0)
Update of members if vehicle leaves a new lane in the lane change step or at arrival.
double getPMxEmissions() const
Returns PMx emission of the current state.
bool myAmOnNet
Whether the vehicle is on the network (not parking, teleported, vaporized, or arrived)
void setBlinkerInformation()
sets the blue flashing light for emergency vehicles
static bool overlap(const MSVehicle *veh1, const MSVehicle *veh2)
double getCurrentApparentDecel() const
get apparent deceleration based on vType parameters and current acceleration
LaneChangeMode myRightDriveLC
changing to the rightmost lane
bool mySpeedAdaptationStarted
Whether influencing the speed has already started.
double getSpaceTillLastStanding(const MSLane *l, bool &foundStopped) const
double implicitSpeedRemote(const MSVehicle *veh, double oldSpeed)
return the speed that is implicit in the new remote position
static std::vector< MSLane * > myEmptyLaneVector
double getPositionOnLane() const
Get the vehicle's position along the lane.
std::pair< const MSVehicle *const, double > getLeader(double dist=0) const
Returns the leader of the vehicle looking for a fixed distance.
std::shared_ptr< MSSimpleDriverState > getDriverState() const
Returns the vehicle driver's state.
const MSCFModel & getCarFollowModel() const
Returns the vehicle type's car following model definition (const version)
bool keepClear(const MSLink *link) const
decide whether the given link must be kept clear
SUMOTime remainingStopDuration() const
Returns the remaining stop duration for a stopped vehicle or 0.
double getActionStepLengthSecs() const
Returns the vehicle's action step length in secs, i.e. the interval between two action points.
SUMOTime myJunctionEntryTime
time at which the current junction was entered
double tauTarget
Target value for the desired time headway.
VehicleState
Definition of a vehicle state.
TraciLaneChangePriority
modes for prioritizing traci lane change requests
double getLengthWithGap() const
Get vehicle's length including the minimum gap [m].
double processTraCISpeedControl(double vSafe, double vNext)
Check for speed advices from the traci client and adjust the speed vNext in the current (euler) / aft...
double getCOEmissions() const
Returns CO emission of the current state.
SUMOTime getLastActionTime() const
Returns the time of the vehicle's last action point.
const MSVehicle * prevLeader
The last recognized leader.
void postProcessRemoteControl(MSVehicle *v)
MSEdgeWeightsStorage & _getWeightsStorage() const
bool hasDriverState() const
Whether this vehicle is equipped with a MSDriverState.
void setSpeedTimeLine(const std::vector< std::pair< SUMOTime, double > > &speedTimeLine)
Sets a new velocity timeline.
SUMOTime myJunctionConflictEntryTime
One of the left doors is opened.
double currentLength
The length which may be driven on this lane.
SUMOTime myWaitingTime
The time the vehicle waits (is not faster than 0.1m/s) in seconds.
bool canReverse(double speedThreshold=SUMO_const_haltingSpeed) const
whether the vehicle is a train that can reverse its direction at the current point in its route
SUMOTime getTimeLoss() const
Returns the SUMOTime lost (speed was lesser maximum speed)
PositionVector getBoundingPoly() const
get bounding polygon
MSCFModel::VehicleVariables * myCFVariables
The per vehicle variables of the car following model.
std::vector< std::pair< SUMOTime, int > > myLaneTimeLine
The lane usage time line to apply.
double myLatDist
The requested lateral change.
void updateDriveItems()
Check whether the drive items (myLFLinkLanes) are up to date, and update them if required.
double myPosLat
the stored lateral position
Position getVelocityVector() const
Returns the vehicle's direction in radians.
void setSublaneChange(double latDist)
Sets a new sublane-change request.
Abstract in-vehicle / in-person device.
MSAbstractLaneChangeModel & getLaneChangeModel()
bool ignoreRed(const MSLink *link, bool canBrake) const
decide whether a red (or yellow light) may be ignore
double getAngle() const
Returns the vehicle's direction in radians.
std::vector< std::vector< LaneQ > > myBestLanes
std::vector< LaneQ >::iterator myCurrentLaneInBestLanes
A point in 2D or 3D with translation and scaling methods.
MSLane * lane
The described lane.
static GapControlVehStateListener vehStateListener
double getEndPos(const SUMOVehicle &veh) const
return halting position for upcoming stop;
void setRoutingMode(int value)
Sets routing behavior.
double getHCEmissions() const
Returns HC emission of the current state.
MSStoppingPlace * containerstop
(Optional) container stop if one is assigned to the stop
const MSLane * myLastBestLanesInternalLane
std::vector< std::pair< int, double > > getStopIndices() const
return list of route indices for the remaining stops
const MSLane * lane
The lane to stop at.
int getSignals() const
Returns the signals.
std::list< Stop > myStops
The vehicle's list of stops.
A road/street connecting two junctions.
MSRouteIterator edge
The edge in the route to stop at.
double occupation
The overall vehicle sum on consecutive lanes which can be passed without a lane change.
bool allowsContinuation
Whether this lane allows to continue the drive.
void workOnMoveReminders(double oldPos, double newPos, double newSpeed)
Processes active move reminder.
const MSEdge * getRerouteOrigin() const
Returns the starting point for reroutes (usually the current edge)
double getNOxEmissions() const
Returns NOx emission of the current state.
const std::vector< double > & getFurtherLanesPosLat() const
double getLastStepDist() const
Get the distance the vehicle covered in the previous timestep.
bool isLeader(const MSLink *link, const MSVehicle *veh) const
whether the given vehicle must be followed at the given junction
SUMOTime myLastActionTime
Action offset (actions are taken at time myActionOffset + N*getActionStepLength()) Initialized to 0,...
MSLane * myLane
The lane the vehicle is on.
bool isStoppedInRange(const double pos, const double tolerance) const
return whether the given position is within range of the current stop
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
void loadState(const SUMOSAXAttributes &attrs, const SUMOTime offset)
Loads the state of this vehicle from the given description.
MSEdgeWeightsStorage * myEdgeWeights
bool myEmergencyBrakeRedLight
Whether red lights are a reason to brake.
double getAccumulatedWaitingSeconds() const
Returns the number of seconds waited (speed was lesser than 0.1m/s) within the last millisecs.
std::shared_ptr< GapControlState > myGapControlState
The gap control state.
double pos() const
Position of this state.
SUMOTime myJunctionEntryTimeNeverYield
LaneChangeMode mySublaneLC
changing to the prefered lateral alignment
static void init()
Static initalization (adds vehicle state listener)
The backwards driving lights are on (no visualisation)
double lastCoveredDist() const
previous Speed of this state
bool myConsiderMaxDeceleration
Whether the maximum deceleration shall be regarded.
void setRemoteState(Position xyPos)
sets position outside the road network
Position myCachedPosition
bool myAmRegisteredAsWaitingForContainer
Whether this vehicle is registered as waiting for a container (for deadlock-recognition)
int getRoutingMode() const
return the current routing mode
double basePos(const MSEdge *edge) const
departure position where the vehicle fits fully onto the edge (if possible)
void setAngle(double angle, bool straightenFurther=false)
Set a custom vehicle angle in rad, optionally updates furtherLanePosLat.
double addGapCurrent
Current, interpolated value for the desired space headway.
const SUMOVehicleParameter::Stop pars
The stop parameter.
bool isRemoteControlled() const
static std::map< const MSVehicle *, GapControlState * > refVehMap
stores reference vehicles currently in use by a gapController
SUMOTime cumulatedWaitingTime(SUMOTime memory=-1) const
void activateReminders(const MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
"Activates" all current move reminder
double myAngle
the angle in radians (
Definition of vehicle stop (position and duration)
MSLane * getLane() const
Returns the lane the vehicle is on.
const ConstMSEdgeVector getStopEdges(double &firstPos, double &lastPos) const
Returns the list of still pending stop edges also returns the first and last stop position.
void appendWaitingTime(SUMOTime dt)
append an amount of dt millisecs to the stored waiting times
DepartLaneDefinition
Possible ways to choose a lane on depart.
double addGapTarget
Target value for the desired space headway.
A blue emergency light is on.
double tauOriginal
Original value for the desired headway (will be reset after duration has expired)
Container for state and parameters of the gap control.
void setBrakingSignals(double vNext)
sets the braking lights on/off
void processLaneAdvances(std::vector< MSLane * > &passedLanes, bool &moved, std::string &emergencyReason)
This method checks if the vehicle has advanced over one or several lanes along its route and triggers...
void addStops(const bool ignoreStopErrors)
Adds stops to the built vehicle.
bool willStop() const
Returns whether the vehicle will stop on the current edge.
MSStoppingPlace * chargingStation
(Optional) charging station if one is assigned to the stop
Influencer & getInfluencer()
Returns the velocity/lane influencer.
void adaptBestLanesOccupation(int laneIndex, double density)
update occupation from MSLaneChanger
double myPos
the stored position
SUMOTime getMemorySize() const
State myState
This Vehicles driving state (pos and speed)
double implicitDeltaPosRemote(const MSVehicle *veh)
return the change in longitudinal position that is implicit in the new remote position
bool myActionStep
The flag myActionStep indicates whether the current time step is an action point for the vehicle.
int numExpectedContainer
The number of still expected containers.
double myAcceleration
The current acceleration after dawdling in m/s.
const MSEdgeWeightsStorage & getWeightsStorage() const
Returns the vehicle's internal edge travel times/efforts container.
void setRemoteControlled(Position xyPos, MSLane *l, double pos, double posLat, double angle, int edgeOffset, const ConstMSEdgeVector &route, SUMOTime t)
std::vector< MSLane * > bestContinuations
const std::vector< MSLane * > & getFurtherLanes() const
MSVehicle()
invalidated default constructor
void updateTimeLoss(double vNext)
Updates the vehicle's time loss.
double myTimeLoss
the time loss in seconds due to driving with less than maximum speed
waitingIntervalList myWaitingIntervals
bool passingMinor() const
decide whether the vehicle is passing a minor link or has comitted to do so
double getLength() const
Returns the length of this link.
void adaptToLeaders(const MSLeaderInfo &ahead, double latOffset, const double seen, DriveProcessItem *const lastLink, const MSLane *const lane, double &v, double &vLinkPass) const
double getActionStepLengthSecs() const
Returns this type's default action step length in seconds.
void adaptLeaveSpeed(const double v)
void updateWaitingTime(double vNext)
Updates the vehicle's waiting time counters (accumulated and consecutive)
double myArrivalSpeedBraking
static SUMOTime gWaitingTimeMemory
length of memory for waiting times (in millisecs)
void resetRoutePosition(int index, DepartLaneDefinition departLaneProcedure)
bool isActionStep(SUMOTime t) const
Returns whether the next simulation step will be an action point for the vehicle.
void checkRewindLinkLanes(const double lengthsInFront, DriveItemVector &lfLinks) const
runs heuristic for keeping the intersection clear in case of downstream jamming
bool myRespectJunctionPriority
Whether the junction priority rules are respected.
MSAbstractLaneChangeModel * myLaneChangeModel
bool addTraciStop(MSLane *const lane, const double startPos, const double endPos, const SUMOTime duration, const SUMOTime until, const bool parking, const bool triggered, const bool containerTriggered, std::string &errorMsg)
double lateralDistanceToLane(const int offset) const
Get the minimal lateral distance required to move fully onto the lane at given offset.
void setLaneChangeMode(int value)
Sets lane changing behavior.
double getElectricityConsumption() const
Returns electricity consumption of the current state.
int getRoutePosition() const
void checkLinkLeader(const MSLink *link, const MSLane *lane, double seen, DriveProcessItem *const lastLink, double &v, double &vLinkPass, double &vLinkWait, bool &setRequest, bool isShadowLink=false) const
checks for link leaders on the given link
double 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)
void setSignals(int signals)
void resetActionOffset(const SUMOTime timeUntilNextAction=0)
Resets the action offset for the vehicle.
bool isRemoteAffected(SUMOTime t) const
double getRightSideOnLane() const
Get the vehicle's lateral position on the lane:
double getLeaveSpeed() const
double spaceHeadwayIncrement
void activate(double tauOriginal, double tauTarget, double additionalGap, double duration, double changeRate, double maxDecel, const MSVehicle *refVeh)
Start gap control with given params.
Influencer * myInfluencer
An instance of a velocity/lane influencing instance; built in "getInfluencer".
void processLinkApproaches(double &vSafe, double &vSafeMin, double &vSafeMinDist)
This method iterates through the driveprocess items for the vehicle and adapts the given in/out param...
virtual ~GapControlState()
The base class for microscopic and mesoscopic vehicles.
const std::vector< MSLane * > & getBestLanesContinuation() const
Returns the best sequence of lanes to continue the route starting at myLane.
bool triggered
whether an arriving person lets the vehicle continue
WaitingTimeCollector(SUMOTime memory=MSGlobals::gWaitingTimeMemory)
Constructor.
void setApproachingForAllLinks(const SUMOTime t)
Register junction approaches for all link items in the current plan.
bool signalSet(int which) const
Returns whether the given signal is on.
double posLat() const
Lateral Position of this state (m relative to the centerline of the lane).
int getLaneChangeMode() const
return the current lane change mode
void deactivate()
Stop gap control.
double getFuelConsumption() const
Returns fuel consumption of the current state.
double getMaxSpeed() const
Get vehicle's maximum speed [m/s].
void checkLinkLeaderCurrentAndParallel(const MSLink *link, const MSLane *lane, double seen, DriveProcessItem *const lastLink, double &v, double &vLinkPass, double &vLinkWait, bool &setRequest) const
checks for link leaders of the current link as well as the parallel link (if there is one)
double getAcceleration() const
Returns the vehicle's acceleration in m/s (this is computed as the last step's mean acceleration in c...
One of the right doors is opened.
int influenceChangeDecision(const SUMOTime currentTime, const MSEdge ¤tEdge, const int currentLaneIndex, int state)
Applies stored LaneChangeMode information and laneTimeLine.
double computeAngle() const
compute the current vehicle angle
The car-following model abstraction.
std::vector< std::pair< SUMOTime, double > > mySpeedTimeLine
The velocity time line to apply.
void setEmergencyBlueLight(SUMOTime currentTime)
sets the blue flashing light for emergency vehicles
SUMOTime getWaitingTime() const
Returns the SUMOTime waited (speed was lesser than 0.1m/s)
bool gapAttained
Whether the desired gap was attained during the current activity phase (induces the remaining duratio...
A yellow emergency light is on.
double backPos() const
back Position of this state
Interface for lane-change models.
Position validatePosition(Position result, double offset=0) const
ensure that a vehicle-relative position is not invalid
bool operator!=(const WaitingTimeCollector &wt) const
Operator !=.
double getLatDist() const
double updateFurtherLanes(std::vector< MSLane * > &furtherLanes, std::vector< double > &furtherLanesPosLat, const std::vector< MSLane * > &passedLanes)
update a vector of further lanes and return the new backPos
double getSpeed() const
Returns the vehicle's current speed.
double changeRate
Rate by which the current time and space headways are changed towards the target value....
SUMOTime getLaneTimeLineDuration()
SUMOTime getLaneTimeLineEnd()
double gapControlSpeed(SUMOTime currentTime, const SUMOVehicle *veh, double speed, double vSafe, double vMin, double vMax)
Applies gap control logic on the speed.
static void cleanup()
Static cleanup (removes vehicle state listener)
void setActionStepLength(double actionStepLength, bool resetActionOffset=true)
Sets the action steplength of the vehicle.
bool replaceRoute(const MSRoute *route, const std::string &info, bool onInit=false, int offset=0, bool addStops=true, bool removeStops=true)
Replaces the current route by the given one.
double getLateralOverlap() const
return the amount by which the vehicle extends laterally outside it's primary lane
const MSVehicle * referenceVeh
reference vehicle for the gap - if it is null, the current leader on the ego's lane is used as a refe...
bool containerTriggered
whether an arriving container lets the vehicle continue
void deactivateGapController()
Deactivates the gap control.
ChangeRequest
Requests set via TraCI.
bool isFrontOnLane(const MSLane *lane) const
Returns the information whether the front of the vehicle is on the given lane.
MSParkingArea * getNextParkingArea()
get the upcoming parking area stop or nullptr
virtual void drawOutsideNetwork(bool)
register vehicle for drawing while outside the network
MSParkingArea * getCurrentParkingArea()
get the current parking area stop or nullptr
double estimateLeaveSpeed(const MSLink *const link, const double vLinkPass) const
estimate leaving speed when accelerating across a link
double getVehicleMaxSpeed(const SUMOTrafficObject *const veh) const
Returns the lane's maximum speed, given a vehicle's speed limit adaptation.
double changeRequestRemainingSeconds(const SUMOTime currentTime) const
Return the remaining number of seconds of the current laneTimeLine assuming one exists.
void adaptToLeader(const std::pair< const MSVehicle *, double > leaderInfo, const double seen, DriveProcessItem *const lastLink, const MSLane *const lane, double &v, double &vLinkPass, double distToCrossing=-1) const
bool getRespectJunctionPriority() const
Returns whether junction priority rules shall be respected.
MSVehicleType * myType
This vehicle's type.
double estimateSpeedAfterDistance(const double dist, const double v, const double accel) const
bool onFurtherEdge(const MSEdge *edge) const
whether this vehicle has its back (and no its front) on the given edge
static bool gSemiImplicitEulerUpdate
WaitingTimeCollector & operator=(const WaitingTimeCollector &wt)
Assignment operator.
double nextStopDist() const
return the distance to the next stop or doubleMax if there is none.
void setSpeedMode(int speedMode)
Sets speed-constraining behaviors.
Encapsulated SAX-Attributes.
Stores the waiting intervals over the previous seconds (memory is to be specified in ms....
double nextOccupation
As occupation, but without the first lane.
void enterLaneAtLaneChange(MSLane *enteredLane)
Update when the vehicle enters a new lane in the laneChange step.
A static instance of this class in GapControlState deactivates gap control for vehicles whose referen...
Notification
Definition of a vehicle state.
double getCO2Emissions() const
Returns CO2 emission of the current state.
bool checkActionStep(const SUMOTime t)
Returns whether the vehicle is supposed to take action in the current simulation step Updates myActio...
virtual ~MSVehicle()
Destructor.
void updateState(double vNext)
updates the vehicles state, given a next value for its speed. This value can be negative in case of t...
bool isStoppedTriggered() const
Returns whether the vehicle is on a triggered stop.
MSDevice_DriverState * myDriverState
This vehicle's driver state.
bool ignoreOverlap() const
double getDeltaPos(const double accel) const
calculates the distance covered in the next integration step given an acceleration and assuming the c...
bool rerouteParkingArea(const std::string &parkingAreaID, std::string &errorMsg)
SUMOTime myLastRemoteAccess
Position getPositionAlongBestLanes(double offset) const
Return the (x,y)-position, which the vehicle would reach if it continued along its best continuation ...
bool unsafeLinkAhead(const MSLane *lane) const
whether the vehicle may safely move to the given lane with regard to upcoming links
Definition of vehicle stop (position and duration)
Drive process items represent bounds on the safe velocity corresponding to the upcoming links.
double getWaitingSeconds() const
Returns the number of seconds waited (speed was lesser than 0.1m/s)
bool replaceParkingArea(MSParkingArea *parkingArea, std::string &errorMsg)
replace the current parking area stop with a new stop with merge duration
State & operator=(const State &state)
Assignment operator.
SUMOTime timeToLoadNextContainer
The time at which the vehicle is able to load another container.
bool hasStops() const
Returns whether the vehicle has to stop somewhere.
Representation of a vehicle in the micro simulation.
double getDistanceToPosition(double destPos, const MSEdge *destEdge) const
DriveItemVector::iterator myNextDriveItem
iterator pointing to the next item in myLFLinkLanes
double getMaxSpeedOnLane() const
Returns the maximal speed for the vehicle on its current lane (including speed factor and deviation,...