213 return predPos - predLength - pos;
347 #ifdef HAVE_INTERNAL_LANES
873 void setSpeedTimeLine(
const std::vector<std::pair<SUMOTime, SUMOReal> >& speedTimeLine);
879 void setLaneTimeLine(
const std::vector<std::pair<SUMOTime, unsigned int> >& laneTimeLine);
1217 (
SUMOReal)sqrt(2 * dist * accel + v * v));
1230 void adaptToLeader(
const std::pair<const MSVehicle*, SUMOReal> leaderInfo,
1231 const SUMOReal seen, DriveProcessItem*
const lastLink,
1233 SUMOReal distToCrossing = -1)
const;
1235 #ifdef HAVE_INTERNAL_LANES
1236 mutable std::set<std::string> myLinkLeaders;
void resetRoutePosition(unsigned int index)
bool signalSet(int which) const
Returns whether the given signal is on.
const MSLane * myLastBestLanesInternalLane
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.
Representation of a vehicle in the micro simulation.
SUMOReal speed() const
Speed of this state.
MSEdgeWeightsStorage * myEdgeWeights
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
const MSEdge * getInternalFollower() const
Returns the lane's follower if it is an internal lane, the edge of the lane otherwise.
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)
SUMOReal getMaxSpeed() const
Returns the maximum speed.
DriveItemVector myLFLinkLanes
Container for used Links/visited Lanes during lookForward.
SUMOReal pos() const
Position of this state.
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()
SUMOReal getLeaveSpeed() const
SUMOReal myAcceleration
The current acceleration after dawdling in m/s.
MSEdgeVector::const_iterator MSRouteIterator
SUMOReal getSpeedWithoutTraciInfluence() const
Returns the uninfluenced velocity.
void setRespectJunctionPriority(bool value)
Sets whether junction priority rules shall be respected.
bool isVTDControlled() const
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)
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.
State(SUMOReal pos, SUMOReal speed)
Constructor.
The high beam lights are on (no visualisation)
Notification
Definition of a vehicle state.
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.
State & operator=(const State &state)
Assignment operator.
The backwards driving lights are on (no visualisation)
vehicle doesn't want to change
unsigned int getPersonNumber() const
Returns the number of persons.
TraciLaneChangePriority
modes for prioritizing traci lane change requests
void postProcessVTD(MSVehicle *v)
SUMOReal estimateLeaveSpeed(const MSLink *const link, const SUMOReal vLinkPass) const
estimate leaving speed when accelerating across a link
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::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
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.
int influenceChangeDecision(const SUMOTime currentTime, const MSEdge ¤tEdge, const unsigned int currentLaneIndex, int state)
Applies stored LaneChangeMode information and laneTimeLine.
void enterLaneAtLaneChange(MSLane *enteredLane)
Update when the vehicle enters a new lane in the laneChange step.
const MSEdge * getRerouteOrigin() const
Returns the starting point for reroutes (usually the current edge)
The car-following model and parameter.
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)
Right blinker lights are switched on.
SUMOReal nextOccupation
As occupation, but without the first lane.
void enterLaneAtInsertion(MSLane *enteredLane, SUMOReal pos, SUMOReal speed, MSMoveReminder::Notification notification)
Update when the vehicle enters a new lane in the emit step.
SUMOReal influenceSpeed(SUMOTime currentTime, SUMOReal speed, SUMOReal vSafe, SUMOReal vMin, SUMOReal vMax)
Applies stored velocity information on the speed to use.
bool operator!=(const State &state)
Operator !=.
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.
void setEmergencyBrakeRedLight(bool value)
Sets whether red lights shall be a reason to brake.
DriveProcessItem(SUMOReal vWait, SUMOReal distance)
constructor if the link shall not be passed
void workOnMoveReminders(SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed)
Processes active move reminder.
vehicle want's to change to right lane
bool addTraciStop(MSLane *lane, SUMOReal pos, SUMOReal radius, SUMOTime duration, bool parking, bool triggered)
Encapsulated SAX-Attributes.
std::vector< const MSEdge * > MSEdgeVector
void setLaneTimeLine(const std::vector< std::pair< SUMOTime, unsigned int > > &laneTimeLine)
Sets a new lane timeline.
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.
TraciLaneChangePriority myTraciLaneChangePriority
flags for determining the priority of traci lane change requests
bool willPass(const MSEdge *const edge) const
Returns whether the vehicle wil pass the given edge.
A lane area vehicles can halt at.
void updateBestLanes(bool forceRebuild=false, const MSLane *startLane=0)
computes the best lanes to use in order to continue the route
Position myCachedPosition
const MSLane * lane
The lane to stop at.
static SUMOReal gap(SUMOReal predPos, SUMOReal predLength, SUMOReal pos)
Uses the given values to compute the brutto-gap.
SUMOReal myOriginalSpeed
The velocity before influence.
std::list< Stop > myStops
The vehicle's list of stops.
bool isStopped() const
Returns whether the vehicle is at a stop.
void setVTDControlled(bool c, MSLane *l, SUMOReal pos, int edgeOffset, const MSEdgeVector &route)
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.
Blinker lights on both sides are switched on.
Influencer * myInfluencer
An instance of a velocity/lane influencing instance; built in "getInfluencer".
std::vector< LaneQ >::iterator myCurrentLaneInBestLanes
SUMOReal getSpaceTillLastStanding(const MSLane *l, bool &foundStopped) const
SUMOTime duration
The stopping duration.
MSVehicle()
invalidated default constructor
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.
Something on a lane to be noticed about vehicle movement.
SUMOReal changeRequestRemainingSeconds(const SUMOTime currentTime) const
Return the remaining number of seconds of the current laneTimeLine assuming one exists.
bool addStop(const SUMOVehicleParameter::Stop &stopPar, SUMOTime untilOffset=0)
Adds a stop.
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
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.
bool knowsEdgeTest(MSEdge &edge) const
bool allowsContinuation
Whether this lane allows to continue the drive.
SUMOReal getHarmonoise_NoiseEmissions() const
Returns noise emissions of the current state.
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.
void planMoveInternal(const SUMOTime t, const MSVehicle *pred, DriveItemVector &lfLinks) const
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.
bool myEmergencyBrakeRedLight
Whether red lights are a reason to brake.
MSEdgeWeightsStorage & _getWeightsStorage() const
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
vehicle want's to change to left lane
void setSpeedTimeLine(const std::vector< std::pair< SUMOTime, SUMOReal > > &speedTimeLine)
Sets a new velocity timeline.
MSVehicle & operator=(const MSVehicle &)
invalidated assignment operator
Influencer & getInfluencer()
Returns the velocity/lane influencer.
Structure representing possible vehicle parameter.
Definition of vehicle stop (position and duration)
bool getEmergencyBrakeRedLight() const
Returns whether red lights shall be a reason to brake.
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.
void setConsiderMaxDeceleration(bool value)
Sets whether the maximum deceleration shall be regarded.
bool fixPosition()
repair errors in vehicle position after changing between internal edges
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.
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.
void setConsiderSafeVelocity(bool value)
Sets whether the safe velocity shall be regarded.
MSRouteIterator edge
The edge in the route to stop at.
SUMOReal getDistanceToPosition(SUMOReal destPos, const MSEdge *destEdge)
SUMOReal getSpeed() const
Returns the vehicle's current speed.
void setLaneChangeMode(int value)
Sets lane changing behavior.
SUMOReal myPos
the stored position
SUMOReal getWaitingSeconds() const
Returns the number of seconds waited (speed was lesser than 0.1m/s)
MSBusStop * busstop
(Optional) bus stop if one is assigned to the stop
bool isStoppedTriggered() const
Returns whether the vehicle is on a triggered stop.
std::vector< DriveProcessItem > DriveItemVector
std::vector< std::pair< SUMOTime, unsigned int > > myLaneTimeLine
The lane usage time line to apply.
void planMove(const SUMOTime t, const MSVehicle *pred, const SUMOReal lengthsInFront)
Compute safe velocities for the upcoming lanes based on positions and speeds from the last time step...
SUMOReal endPos
The stopping position end.
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.
void switchOffSignal(int signal)
Switches the given signal off.
void switchOnSignal(int signal)
Switches the given signal on.
static std::vector< MSLane * > myEmptyLaneVector
void adaptBestLanesOccupation(int laneIndex, SUMOReal density)
update occupation from MSLaneChanger
static bool overlap(const MSVehicle *veh1, const MSVehicle *veh2)
MSRouteIterator myCurrEdge
Iterator to current route-edge.
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.
void addPerson(MSPerson *person)
Adds a passenger.
SUMOReal startPos
The stopping position start.
A red emergency light is on.
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.
LaneChangeMode myStrategicLC
lane changing which is necessary to follow the current route
SUMOTime myArrivalTimeBraking
unsigned int getRoutePosition() const
One of the right doors is opened.
Interface for lane-change models.
MSDevice_Person * myPersonDevice
The passengers this vehicle may have.
int getBestLaneOffset() const
returns the current offset from the best lane
bool myConsiderSafeVelocity
Whether the safe velocity shall be regarded.
void setConsiderMaxAcceleration(bool value)
Sets whether the maximum acceleration shall be regarded.
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.
unsigned int getLaneIndex() const