SUMO - Simulation of Urban MObility
MSMoveReminder Class Reference

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

#include <MSMoveReminder.h>

Inheritance diagram for MSMoveReminder:
Inheritance graph
Collaboration diagram for MSMoveReminder:
Collaboration graph

Public Types

enum  Notification {
  NOTIFICATION_DEPARTED, NOTIFICATION_JUNCTION, NOTIFICATION_SEGMENT, NOTIFICATION_LANE_CHANGE,
  NOTIFICATION_TELEPORT, NOTIFICATION_PARKING, NOTIFICATION_ARRIVED, NOTIFICATION_VAPORIZED,
  NOTIFICATION_TELEPORT_ARRIVED
}
 Definition of a vehicle state. More...
 

Public Member Functions

const std::string & getDescription () const
 
const MSLanegetLane () const
 Returns the lane the reminder works on. More...
 
 MSMoveReminder (const std::string &description, MSLane *const lane=0, const bool doAdd=true)
 Constructor. More...
 
virtual void notifyMoveInternal (const SUMOVehicle &veh, const SUMOReal frontOnLane, const SUMOReal timeOnLane, const SUMOReal meanSpeedFrontOnLane, const SUMOReal meanSpeedVehicleOnLane, const SUMOReal travelledDistanceFrontOnLane, const SUMOReal travelledDistanceVehicleOnLane)
 Internal notification about the vehicle moves. More...
 
void setDescription (const std::string &description)
 
virtual ~MSMoveReminder ()
 Destructor. More...
 
Interface methods, to be derived by subclasses
virtual bool notifyEnter (SUMOVehicle &veh, Notification reason)
 Checks whether the reminder is activated by a vehicle entering the lane. More...
 
virtual bool notifyMove (SUMOVehicle &veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed)
 Checks whether the reminder still has to be notified about the vehicle moves. More...
 
virtual bool notifyLeave (SUMOVehicle &veh, SUMOReal lastPos, Notification reason)
 Called if the vehicle leaves the reminder's lane. More...
 
void updateDetector (SUMOVehicle &veh, SUMOReal entryPos, SUMOReal leavePos, SUMOTime entryTime, SUMOTime currentTime, SUMOTime leaveTime, bool cleanUp)
 

Protected Member Functions

void removeFromVehicleUpdateValues (SUMOVehicle &veh)
 

Protected Attributes

std::string myDescription
 a description of this moveReminder More...
 
MSLane *const myLane
 Lane on which the reminder works. More...
 

Private Member Functions

MSMoveReminderoperator= (const MSMoveReminder &)
 

Private Attributes

std::map< SUMOVehicle *, std::pair< SUMOTime, SUMOReal > > myLastVehicleUpdateValues
 

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 70 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) XXX: What if a vehicle changes lanes and passes a junction simultaneously?

NOTIFICATION_TELEPORT 

The vehicle is being teleported.

NOTIFICATION_PARKING 

The vehicle starts or ends parking.

NOTIFICATION_ARRIVED 

The vehicle arrived at its destination (is deleted)

NOTIFICATION_VAPORIZED 

The vehicle got vaporized.

NOTIFICATION_TELEPORT_ARRIVED 

The vehicle was teleported out of the net.

Definition at line 95 of file MSMoveReminder.h.

Constructor & Destructor Documentation

§ MSMoveReminder()

MSMoveReminder::MSMoveReminder ( const std::string &  description,
MSLane *const  lane = 0,
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 40 of file MSMoveReminder.cpp.

References MSLane::addMoveReminder(), and myLane.

§ ~MSMoveReminder()

virtual MSMoveReminder::~MSMoveReminder ( )
inlinevirtual

Destructor.

Definition at line 82 of file MSMoveReminder.h.

Member Function Documentation

§ getDescription()

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

Definition at line 225 of file MSMoveReminder.h.

References myDescription, and removeFromVehicleUpdateValues().

Referenced by MSBaseVehicle::addStops().

§ getLane()

§ notifyEnter()

virtual bool MSMoveReminder::notifyEnter ( SUMOVehicle veh,
Notification  reason 
)
inlinevirtual

Checks whether the reminder is activated by a vehicle entering the lane.

Lane change means in this case that the vehicle changes to the lane the reminder is placed at.

Parameters
[in]vehThe entering vehicle.
[in]reasonhow the vehicle enters the lane
Returns
True if vehicle enters the reminder.
See also
Notification

Reimplemented in MSMeanData::MeanDataValueTracker, MSE2Collector, MSDevice_Routing, MSTriggeredRerouter, MSMeanData_Net::MSLaneMeanDataValues, MSCalibrator::VehicleRemover, MSInductLoop, MSDevice_Tripinfo, MSMeanData_Amitran::MSLaneMeanDataValues, MSDevice_Example, MSDevice_BTsender, MSMeanData::MeanDataValues, MSDevice_BTreceiver, MSDevice_Vehroutes, MSRouteProbe, MSDevice_Battery, and MSDevice_Transportable.

Definition at line 130 of file MSMoveReminder.h.

References UNUSED_PARAMETER.

§ notifyLeave()

virtual bool MSMoveReminder::notifyLeave ( SUMOVehicle veh,
SUMOReal  lastPos,
Notification  reason 
)
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 MSMeanData::MeanDataValueTracker, MSE2Collector, MSE3Collector::MSE3LeaveReminder, MSInductLoop, MSTriggeredRerouter, MSDevice_BTsender, MSDevice_BTreceiver, MSMeanData::MeanDataValues, MSDevice_Tripinfo, MSDevice_Example, MSInstantInductLoop, MSDevice_Vehroutes, MSE3Collector::MSE3EntryReminder, MSMeanData_Net::MSLaneMeanDataValues, and MSDevice_Transportable.

Definition at line 175 of file MSMoveReminder.h.

References SUMOReal, UNUSED_PARAMETER, and updateDetector().

§ notifyMove()

virtual bool MSMoveReminder::notifyMove ( SUMOVehicle veh,
SUMOReal  oldPos,
SUMOReal  newPos,
SUMOReal  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 it's 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 MSE2Collector, MSE3Collector::MSE3LeaveReminder, MSTriggeredRerouter, MSInductLoop, MSDevice_BTsender, MSMeanData::MeanDataValues, MSDevice_BTreceiver, MSDevice_Emissions, MSDevice_Tripinfo, MSInstantInductLoop, MSE3Collector::MSE3EntryReminder, MSDevice_Example, MSDevice_Battery, and MSDevice_Transportable.

Definition at line 150 of file MSMoveReminder.h.

References UNUSED_PARAMETER.

§ notifyMoveInternal()

virtual void MSMoveReminder::notifyMoveInternal ( const SUMOVehicle veh,
const SUMOReal  frontOnLane,
const SUMOReal  timeOnLane,
const SUMOReal  meanSpeedFrontOnLane,
const SUMOReal  meanSpeedVehicleOnLane,
const SUMOReal  travelledDistanceFrontOnLane,
const SUMOReal  travelledDistanceVehicleOnLane 
)
inlinevirtual

Internal notification 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 it's 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.

Reimplemented in MSMeanData::MeanDataValueTracker, MSDevice_Tripinfo, MSMeanData_Net::MSLaneMeanDataValues, MSMeanData_Amitran::MSLaneMeanDataValues, MSMeanData_Harmonoise::MSLaneMeanDataValues, and MSMeanData_Emissions::MSLaneMeanDataValues.

Definition at line 205 of file MSMoveReminder.h.

References UNUSED_PARAMETER.

Referenced by MSMeanData::MeanDataValues::notifyMove(), and updateDetector().

§ operator=()

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

§ removeFromVehicleUpdateValues()

void MSMoveReminder::removeFromVehicleUpdateValues ( SUMOVehicle veh)
protected

§ setDescription()

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

§ updateDetector()

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

Field Documentation

§ myDescription

std::string MSMoveReminder::myDescription
protected

a description of this moveReminder

Definition at line 237 of file MSMoveReminder.h.

Referenced by getDescription(), and setDescription().

§ myLane

§ myLastVehicleUpdateValues

std::map<SUMOVehicle*, std::pair<SUMOTime, SUMOReal> > MSMoveReminder::myLastVehicleUpdateValues
private

Definition at line 240 of file MSMoveReminder.h.

Referenced by removeFromVehicleUpdateValues(), and updateDetector().


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