Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MSMoveReminder Class Reference

Something on a lane to be noticed about vehicle movement. More...

#include <MSMoveReminder.h>

Inheritance diagram for MSMoveReminder:
[legend]
Collaboration diagram for MSMoveReminder:
[legend]

Public Types

enum  Notification {
  NOTIFICATION_DEPARTED , NOTIFICATION_JUNCTION , NOTIFICATION_SEGMENT , NOTIFICATION_LANE_CHANGE ,
  NOTIFICATION_LOAD_STATE , NOTIFICATION_TELEPORT , NOTIFICATION_TELEPORT_CONTINUATION , NOTIFICATION_PARKING ,
  NOTIFICATION_PARKING_REROUTE , NOTIFICATION_ARRIVED , NOTIFICATION_TELEPORT_ARRIVED , NOTIFICATION_VAPORIZED_CALIBRATOR ,
  NOTIFICATION_VAPORIZED_COLLISION , NOTIFICATION_VAPORIZED_TRACI , NOTIFICATION_VAPORIZED_GUI , NOTIFICATION_VAPORIZED_VAPORIZER ,
  NOTIFICATION_VAPORIZED_BREAKDOWN , NOTIFICATION_NONE
}
 Definition of a vehicle state. More...
 

Public Member Functions

const std::string & getDescription () const
 
const MSLanegetLane () const
 Returns the lane the reminder works on.
 
virtual bool isParkingRerouter () const
 
 MSMoveReminder (const std::string &description, MSLane *const lane=nullptr, const bool doAdd=true)
 Constructor.
 
virtual void notifyMoveInternal (const SUMOTrafficObject &veh, const double frontOnLane, const double timeOnLane, const double meanSpeedFrontOnLane, const double meanSpeedVehicleOnLane, const double travelledDistanceFrontOnLane, const double travelledDistanceVehicleOnLane, const double meanLengthOnLane)
 Internal notification about the vehicle moves.
 
void setDescription (const std::string &description)
 
virtual ~MSMoveReminder ()
 Destructor.
 
Interface methods, to be derived by subclasses
virtual bool notifyEnter (SUMOTrafficObject &veh, Notification reason, const MSLane *enteredLane)
 Checks whether the reminder is activated by a vehicle entering the lane.
 
virtual bool notifyMove (SUMOTrafficObject &veh, double oldPos, double newPos, double newSpeed)
 Checks whether the reminder still has to be notified about the vehicle moves.
 
virtual bool notifyIdle (SUMOTrafficObject &veh)
 Computes idling emission values and adds them to the emission sums.
 
virtual void notifyParking ()
 called to update state for parking vehicles
 
virtual void notifyStopEnded ()
 called to update state for stopped vehicles
 
virtual bool notifyLeave (SUMOTrafficObject &veh, double lastPos, Notification reason, const MSLane *enteredLane=nullptr)
 Called if the vehicle leaves the reminder's lane.
 
virtual bool notifyLeaveBack (SUMOTrafficObject &veh, Notification reason, const MSLane *leftLane)
 Called if the vehicle's back leaves the reminder's lane.
 
void updateDetector (SUMOTrafficObject &veh, double entryPos, double leavePos, SUMOTime entryTime, SUMOTime currentTime, SUMOTime leaveTime, bool cleanUp)
 

Static Public Attributes

static StringBijection< NotificationNotifications
 

Protected Member Functions

void removeFromVehicleUpdateValues (SUMOTrafficObject &veh)
 

Protected Attributes

std::string myDescription
 a description of this moveReminder
 
MSLanemyLane
 Lane on which the reminder works.
 

Private Member Functions

MSMoveReminderoperator= (const MSMoveReminder &)
 

Private Attributes

std::map< long long int, std::pair< SUMOTime, double > > myLastVehicleUpdateValues
 

Static Private Attributes

static StringBijection< Notification >::Entry NotificationValues []
 

Detailed Description

Something on a lane to be noticed about vehicle movement.

Base class of all move-reminders. During move, the vehicles call notifyMove() for all reminders on their current lane (all lanes they pass during one step). If a vehicle enters the lane the reminder is positioned at during insertion or lanechange notifyEnter() is called. If a vehicle leaves the reminder lane it calls notifyLeave().

The reminder knows whom to tell about move, insertion and lanechange. The vehicles will remove the reminder that is not notifyMove() from their reminder container.

See also
MSLane::addMoveReminder
MSLane::getMoveReminder
Note
: cannot inherit from Named because it would couse double inheritance

Definition at line 65 of file MSMoveReminder.h.

Member Enumeration Documentation

◆ Notification

Definition of a vehicle state.

Enumerator
NOTIFICATION_DEPARTED 

The vehicle has departed (was inserted into the network)

NOTIFICATION_JUNCTION 

The vehicle arrived at a junction.

NOTIFICATION_SEGMENT 

The vehicle changes the segment (meso only)

NOTIFICATION_LANE_CHANGE 

The vehicle changes lanes (micro only)

NOTIFICATION_LOAD_STATE 

The vehicle has been loaded from a state file.

NOTIFICATION_TELEPORT 

The vehicle is being teleported.

NOTIFICATION_TELEPORT_CONTINUATION 

The vehicle continues being teleported past an edge.

NOTIFICATION_PARKING 

The vehicle starts or ends parking.

NOTIFICATION_PARKING_REROUTE 

The vehicle needs another parking area.

NOTIFICATION_ARRIVED 

The vehicle arrived at its destination (is deleted)

NOTIFICATION_TELEPORT_ARRIVED 

The vehicle was teleported out of the net.

NOTIFICATION_VAPORIZED_CALIBRATOR 

The vehicle got removed by a calibrator.

NOTIFICATION_VAPORIZED_COLLISION 

The vehicle got removed by a collision.

NOTIFICATION_VAPORIZED_TRACI 

The vehicle got removed via TraCI.

NOTIFICATION_VAPORIZED_GUI 

The vehicle got removed via the GUI.

NOTIFICATION_VAPORIZED_VAPORIZER 

The vehicle got vaporized with a vaporizer.

NOTIFICATION_VAPORIZED_BREAKDOWN 

The vehicle got removed via stationfinder device.

NOTIFICATION_NONE 

must be the last one

Definition at line 90 of file MSMoveReminder.h.

Constructor & Destructor Documentation

◆ MSMoveReminder()

MSMoveReminder::MSMoveReminder ( const std::string &  description,
MSLane *const  lane = nullptr,
const bool  doAdd = true 
)

Constructor.

Parameters
[in]laneLane on which the reminder will work.
[in]doAddwhether to add the reminder to the lane

Definition at line 55 of file MSMoveReminder.cpp.

References MSLane::addMoveReminder(), and myLane.

◆ ~MSMoveReminder()

virtual MSMoveReminder::~MSMoveReminder ( )
inlinevirtual

Destructor.

Definition at line 77 of file MSMoveReminder.h.

Member Function Documentation

◆ getDescription()

const std::string & MSMoveReminder::getDescription ( ) const
inline

Definition at line 283 of file MSMoveReminder.h.

References myDescription.

Referenced by MSDriveWay::notifyEnter(), MSDriveWay::notifyLeave(), and MSDriveWay::notifyLeaveBack().

Here is the caller graph for this function:

◆ getLane()

const MSLane * MSMoveReminder::getLane ( ) const
inline

Returns the lane the reminder works on.

Returns
The lane the reminder is anchored on.

Definition at line 84 of file MSMoveReminder.h.

References myLane.

Referenced by LIBSUMO_NAMESPACE::InductionLoop::getTree(), GUIInductLoop::MyWrapper::MyWrapper(), GUIInstantInductLoop::MyWrapper::MyWrapper(), MSDevice_Tripinfo::notifyEnter(), MSDevice_Tripinfo::notifyLeave(), LIBSUMO_NAMESPACE::InductionLoop::storeShape(), and MSMeanData::writeEdge().

Here is the caller graph for this function:

◆ isParkingRerouter()

virtual bool MSMoveReminder::isParkingRerouter ( ) const
inlinevirtual

Reimplemented in MSTriggeredRerouter.

Definition at line 288 of file MSMoveReminder.h.

◆ notifyEnter()

virtual bool MSMoveReminder::notifyEnter ( SUMOTrafficObject veh,
Notification  reason,
const MSLane enteredLane 
)
inlinevirtual

◆ notifyIdle()

virtual bool MSMoveReminder::notifyIdle ( SUMOTrafficObject veh)
inlinevirtual

Computes idling emission values and adds them to the emission sums.

Idling implied by zero velocity, acceleration and slope

Parameters
[in]vehThe vehicle
See also
MSMoveReminder::notifyMove
PollutantsInterface

Reimplemented in MSDevice_Emissions, MSDevice_Tripinfo, MSMeanData_Emissions::MSLaneMeanDataValues, and MSDevice_StationFinder.

Definition at line 186 of file MSMoveReminder.h.

References UNUSED_PARAMETER.

◆ notifyLeave()

virtual bool MSMoveReminder::notifyLeave ( SUMOTrafficObject veh,
double  lastPos,
Notification  reason,
const MSLane enteredLane = nullptr 
)
inlinevirtual

Called if the vehicle leaves the reminder's lane.

Informs if vehicle leaves reminder lane (due to lane change, removal from the network, or leaving to the next lane). The default is to do nothing.

Parameters
[in]vehThe leaving vehicle.
[in]lastPosPosition on the lane when leaving.
[in]reasonhow the vehicle leaves the lane
See also
Notification
Returns
True if the reminder wants to receive further info.

Reimplemented in MSDevice_ElecHybrid, MSDevice_Bluelight, MSTransportableDevice_BTreceiver, MSTransportableDevice_BTsender, MSDevice_Example, MSDevice_SSM, MSDevice_Transportable, MSDevice_Tripinfo, MSE2Collector, MSE3Collector::MSE3EntryReminder, MSE3Collector::MSE3LeaveReminder, MSInductLoop, MSInstantInductLoop, MSMeanData::MeanDataValues, MSMeanData::MeanDataValueTracker, MSMeanData_Net::MSLaneMeanDataValues, MSTriggeredRerouter, MSVehicleDevice_BTreceiver, MSVehicleDevice_BTsender, MSDevice_Vehroutes, MSDriveWay, and MSCalibrator::VehicleRemover.

Definition at line 210 of file MSMoveReminder.h.

References UNUSED_PARAMETER.

◆ notifyLeaveBack()

virtual bool MSMoveReminder::notifyLeaveBack ( SUMOTrafficObject veh,
Notification  reason,
const MSLane leftLane 
)
inlinevirtual

Called if the vehicle's back leaves the reminder's lane.

Informs if vehicle back leaves reminder lane (due to lane change, removal from the network, or leaving to the next lane). The default is to do nothing.

Parameters
[in]vehThe leaving vehicle.
[in]reasonhow the vehicle leaves the lane
[in]leftLaneThe lane that the vehicle's back left
See also
Notification
Returns
True if the reminder wants to receive further info.

Reimplemented in MSDriveWay.

Definition at line 231 of file MSMoveReminder.h.

References UNUSED_PARAMETER.

◆ notifyMove()

virtual bool MSMoveReminder::notifyMove ( SUMOTrafficObject veh,
double  oldPos,
double  newPos,
double  newSpeed 
)
inlinevirtual

Checks whether the reminder still has to be notified about the vehicle moves.

Indicator if the reminders is still active for the passed vehicle/parameters. If false, the vehicle will erase this reminder from its reminder-container.

Parameters
[in]vehVehicle that asks this reminder.
[in]oldPosPosition before move.
[in]newPosPosition after move with newSpeed.
[in]newSpeedMoving speed.
Returns
True if vehicle hasn't passed the reminder completely.

Reimplemented in MSDevice_ElecHybrid, MSDevice_Bluelight, MSVehicleDevice_BTreceiver, MSTransportableDevice_BTreceiver, MSVehicleDevice_BTsender, MSTransportableDevice_BTsender, MSDevice_Emissions, MSDevice_Example, MSDevice_Friction, MSDevice_GLOSA, MSDevice_SSM, MSDevice_Taxi, MSDevice_Transportable, MSDevice_Tripinfo, MSE2Collector, MSInductLoop, MSInstantInductLoop, MSMeanData::MeanDataValues, MSTriggeredRerouter, MSDevice_Battery, MSDevice_StationFinder, MSDevice_ToC, MSE3Collector::MSE3LeaveReminder, and MSE3Collector::MSE3EntryReminder.

Definition at line 166 of file MSMoveReminder.h.

References UNUSED_PARAMETER.

Referenced by MSE3Collector::notifyMovePerson().

Here is the caller graph for this function:

◆ notifyMoveInternal()

virtual void MSMoveReminder::notifyMoveInternal ( const SUMOTrafficObject veh,
const double  frontOnLane,
const double  timeOnLane,
const double  meanSpeedFrontOnLane,
const double  meanSpeedVehicleOnLane,
const double  travelledDistanceFrontOnLane,
const double  travelledDistanceVehicleOnLane,
const double  meanLengthOnLane 
)
inlinevirtual

Internal notification about the vehicle moves.

Note
meso uses this though it never calls notifyMove()

Indicator if the reminders is still active for the passed vehicle/parameters. If false, the vehicle will erase this reminder from its reminder-container.

Parameters
[in]vehVehicle that asks this reminder.
[in]frontOnLanetime the front of the vehicle spent on the lane.
[in]timeOnLanetime some part of the vehicle spent on the lane.
[in]meanSpeedFrontOnLaneAverage speed for the time that the front is on the lane.
[in]meanSpeedVehicleOnLaneAverage speed for the time that the vehicle is on the lane (with front or back).
[in]travelledDistanceFrontOnLanedistance travelled while overlapping with the lane.
[in]travelledDistanceVehicleOnLanedistance travelled while front was on the lane.
[in]meanLengthOnLanethe average length of the vehicle's part on the lane during the last step (==complete length in meso case)

Reimplemented in MSDevice_ElecHybrid, MSDevice_Emissions, MSDevice_Taxi, MSDevice_Transportable, MSDevice_Tripinfo, MSMeanData::MeanDataValueTracker, MSDevice_StationFinder, MSMeanData_Net::MSLaneMeanDataValues, MSMeanData_Harmonoise::MSLaneMeanDataValues, MSMeanData_Amitran::MSLaneMeanDataValues, and MSMeanData_Emissions::MSLaneMeanDataValues.

Definition at line 261 of file MSMoveReminder.h.

References UNUSED_PARAMETER.

Referenced by updateDetector().

Here is the caller graph for this function:

◆ notifyParking()

virtual void MSMoveReminder::notifyParking ( )
inlinevirtual

called to update state for parking vehicles

Reimplemented in MSDevice_Battery.

Definition at line 192 of file MSMoveReminder.h.

◆ notifyStopEnded()

virtual void MSMoveReminder::notifyStopEnded ( )
inlinevirtual

called to update state for stopped vehicles

Reimplemented in MSDevice_Routing, and MSDevice_Vehroutes.

Definition at line 195 of file MSMoveReminder.h.

◆ operator=()

MSMoveReminder & MSMoveReminder::operator= ( const MSMoveReminder )
private

◆ removeFromVehicleUpdateValues()

void MSMoveReminder::removeFromVehicleUpdateValues ( SUMOTrafficObject veh)
protected

Definition at line 112 of file MSMoveReminder.cpp.

References SUMOTrafficObject::getNumericalID(), and myLastVehicleUpdateValues.

Referenced by updateDetector().

Here is the caller graph for this function:

◆ setDescription()

void MSMoveReminder::setDescription ( const std::string &  description)
inline

Definition at line 279 of file MSMoveReminder.h.

References myDescription.

Referenced by MSMeanData::init(), MEInductLoop::MEInductLoop(), METriggeredCalibrator::METriggeredCalibrator(), and MSCalibrator::MSCalibrator().

Here is the caller graph for this function:

◆ updateDetector()

void MSMoveReminder::updateDetector ( SUMOTrafficObject veh,
double  entryPos,
double  leavePos,
SUMOTime  entryTime,
SUMOTime  currentTime,
SUMOTime  leaveTime,
bool  cleanUp 
)

Definition at line 70 of file MSMoveReminder.cpp.

References SUMOTrafficObject::getNumericalID(), myLastVehicleUpdateValues, notifyMoveInternal(), removeFromVehicleUpdateValues(), and STEPS2TIME.

Referenced by MEVehicle::updateDetectorForWriting().

Here is the caller graph for this function:

Field Documentation

◆ myDescription

std::string MSMoveReminder::myDescription
protected

a description of this moveReminder

Definition at line 302 of file MSMoveReminder.h.

Referenced by getDescription(), and setDescription().

◆ myLane

◆ myLastVehicleUpdateValues

std::map<long long int, std::pair<SUMOTime, double> > MSMoveReminder::myLastVehicleUpdateValues
private

Definition at line 310 of file MSMoveReminder.h.

Referenced by removeFromVehicleUpdateValues(), and updateDetector().

◆ Notifications

StringBijection< MSMoveReminder::Notification > MSMoveReminder::Notifications
static

Definition at line 292 of file MSMoveReminder.h.

Referenced by MSDriveWay::writeBlockVehicles().

◆ NotificationValues

StringBijection< MSMoveReminder::Notification >::Entry MSMoveReminder::NotificationValues
staticprivate
Initial value:
= {
{"departed", NOTIFICATION_DEPARTED},
{"junction", NOTIFICATION_JUNCTION},
{"segment", NOTIFICATION_SEGMENT},
{"laneChange", NOTIFICATION_LANE_CHANGE},
{"loadState", NOTIFICATION_LOAD_STATE},
{"teleport", NOTIFICATION_TELEPORT},
{"teleportContinuation", NOTIFICATION_TELEPORT_CONTINUATION},
{"parking", NOTIFICATION_PARKING},
{"parkingReroute", NOTIFICATION_PARKING_REROUTE},
{"arrived", NOTIFICATION_ARRIVED},
{"teleportArrived", NOTIFICATION_TELEPORT_ARRIVED},
{"vaporizedCalibrator", NOTIFICATION_VAPORIZED_CALIBRATOR},
{"vaporizedCollision", NOTIFICATION_VAPORIZED_COLLISION},
{"vaporizedTraCI", NOTIFICATION_VAPORIZED_TRACI},
{"vaporizedGUI", NOTIFICATION_VAPORIZED_GUI},
{"vaporizedBreakdown", NOTIFICATION_VAPORIZED_BREAKDOWN},
}
@ NOTIFICATION_VAPORIZED_TRACI
The vehicle got removed via TraCI.
@ NOTIFICATION_ARRIVED
The vehicle arrived at its destination (is deleted)
@ NOTIFICATION_TELEPORT_ARRIVED
The vehicle was teleported out of the net.
@ NOTIFICATION_PARKING_REROUTE
The vehicle needs another parking area.
@ NOTIFICATION_VAPORIZED_CALIBRATOR
The vehicle got removed by a calibrator.
@ NOTIFICATION_VAPORIZED_GUI
The vehicle got removed via the GUI.
@ NOTIFICATION_DEPARTED
The vehicle has departed (was inserted into the network)
@ NOTIFICATION_SEGMENT
The vehicle changes the segment (meso only)
@ NOTIFICATION_LANE_CHANGE
The vehicle changes lanes (micro only)
@ NOTIFICATION_VAPORIZED_VAPORIZER
The vehicle got vaporized with a vaporizer.
@ NOTIFICATION_JUNCTION
The vehicle arrived at a junction.
@ NOTIFICATION_VAPORIZED_BREAKDOWN
The vehicle got removed via stationfinder device.
@ NOTIFICATION_PARKING
The vehicle starts or ends parking.
@ NOTIFICATION_VAPORIZED_COLLISION
The vehicle got removed by a collision.
@ NOTIFICATION_LOAD_STATE
The vehicle has been loaded from a state file.
@ NOTIFICATION_TELEPORT
The vehicle is being teleported.
@ NOTIFICATION_NONE
must be the last one
@ NOTIFICATION_TELEPORT_CONTINUATION
The vehicle continues being teleported past an edge.

Definition at line 28 of file MSMoveReminder.h.


The documentation for this class was generated from the following files: