MSMoveReminder Class Reference

#include <MSMoveReminder.h>

Inheritance diagram for MSMoveReminder:

MSE2Collector MSE3Collector::MSE3EntryReminder MSE3Collector::MSE3LeaveReminder MSInductLoop MSMeanData::MeanDataValues MSRouteProbe::EntryReminder MSTriggeredRerouter::Setter GUI_E2_ZS_Collector GUIInductLoop MSMeanData::MeanDataValueTracker MSMeanData_Harmonoise::MSLaneMeanDataValues MSMeanData_HBEFA::MSLaneMeanDataValues MSMeanData_Net::MSLaneMeanDataValues

Detailed Description

Something on a lane to be noticed about vehicle movement.

Base class of all move-reminders. During move, the vehicles call isStillActive() 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 emit or lanechange notifyEnter() is called. If a vehicle leaves the reminder lane it calls notifyLeave().

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

See also:
MSLane::addMoveReminder

MSLane::getMoveReminder

Definition at line 60 of file MSMoveReminder.h.


Public Member Functions

const MSLane *const getLane () const throw ()
 Returns the lane the reminder works on.
 MSMoveReminder (MSLane *const lane, const bool doAdd=true) throw ()
 Constructor.
virtual ~MSMoveReminder () throw ()
 Destructor.
Interface methods, to be derived by subclasses
virtual bool isStillActive (MSVehicle &veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed) throw ()
 Checks whether the reminder still has to be notified about the vehicle moves.
virtual bool notifyEnter (MSVehicle &veh, bool isEmit, bool isLaneChange) throw ()
 Checks whether the reminder is activated by the vehicle's emission on lane change.
virtual void notifyLeave (MSVehicle &veh, bool isArrival, bool isLaneChange) throw ()
 Called if the vehicle leaves the reminder's lane.

Protected Attributes

MSLane *const myLane
 Lane on which the reminder works.

Constructor & Destructor Documentation

MSMoveReminder::MSMoveReminder ( MSLane *const   lane,
const bool  doAdd = true 
) throw ()

Constructor.

Parameters:
[in] lane Lane on which the reminder will work.
[in] doAdd whether to add the reminder to the lane
Todo:
Why is the lane not given as a reference?

Definition at line 38 of file MSMoveReminder.cpp.

00039         : myLane(lane) {
00040     if (myLane!=0 && doAdd) {
00041         // add reminder to lane
00042         myLane->addMoveReminder(this);
00043     }
00044 }

virtual MSMoveReminder::~MSMoveReminder (  )  throw () [inline, virtual]

Destructor.

Definition at line 73 of file MSMoveReminder.h.

00073 {}


Member Function Documentation

const MSLane* const MSMoveReminder::getLane (  )  const throw () [inline]

virtual bool MSMoveReminder::isStillActive ( MSVehicle veh,
SUMOReal  oldPos,
SUMOReal  newPos,
SUMOReal  newSpeed 
) throw () [inline, virtual]

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:
veh Vehicle that asks this reminder.
oldPos Position before move.
newPos Position after move with newSpeed.
newSpeed Moving speed.
Returns:
True if vehicle hasn't passed the reminder completely.

Reimplemented in MSE2Collector, MSE3Collector::MSE3EntryReminder, MSE3Collector::MSE3LeaveReminder, MSInductLoop, MSMeanData::MeanDataValueTracker, MSMeanData_Harmonoise::MSLaneMeanDataValues, MSMeanData_HBEFA::MSLaneMeanDataValues, MSMeanData_Net::MSLaneMeanDataValues, and MSTriggeredRerouter::Setter.

Definition at line 101 of file MSMoveReminder.h.

00104                                                           {
00105         return true;
00106     }

virtual bool MSMoveReminder::notifyEnter ( MSVehicle veh,
bool  isEmit,
bool  isLaneChange 
) throw () [inline, virtual]

Checks whether the reminder is activated by the vehicle's emission on lane change.

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

Parameters:
[in] veh The entering vehicle.
[in] isEmit whether the vehicle was just emitted into the net
[in] isLaneChange whether the vehicle changed to the lane
Returns:
True if vehicle enters the reminder.

Reimplemented in MSE2Collector, MSE3Collector::MSE3EntryReminder, MSE3Collector::MSE3LeaveReminder, MSInductLoop, MSMeanData::MeanDataValueTracker, MSMeanData_Harmonoise::MSLaneMeanDataValues, MSMeanData_Net::MSLaneMeanDataValues, MSRouteProbe::EntryReminder, and MSTriggeredRerouter::Setter.

Definition at line 133 of file MSMoveReminder.h.

00133                                                                                      {
00134         return true;
00135     }

virtual void MSMoveReminder::notifyLeave ( MSVehicle veh,
bool  isArrival,
bool  isLaneChange 
) throw () [inline, virtual]

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] veh The leaving vehicle.
[in] isArrival whether the vehicle arrived at its destination
[in] isLaneChange whether the vehicle changed from the lane

Reimplemented in MSE2Collector, MSInductLoop, MSMeanData::MeanDataValueTracker, and MSMeanData_Net::MSLaneMeanDataValues.

Definition at line 119 of file MSMoveReminder.h.

00119 {};


Field Documentation

MSLane* const MSMoveReminder::myLane [protected]


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

Generated on Wed May 5 00:06:49 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6