![]() |
Eclipse SUMO - Simulation of Urban MObility
|
Something on a lane to be noticed about vehicle movement. More...
#include <MSMoveReminder.h>
Public Types | |
enum | Notification { NOTIFICATION_DEPARTED, NOTIFICATION_JUNCTION, NOTIFICATION_SEGMENT, NOTIFICATION_LANE_CHANGE, NOTIFICATION_TELEPORT, NOTIFICATION_PARKING, NOTIFICATION_ARRIVED, NOTIFICATION_VAPORIZED, NOTIFICATION_TELEPORT_ARRIVED, NOTIFICATION_PARKING_REROUTE } |
Definition of a vehicle state. More... | |
Public Member Functions | |
const std::string & | getDescription () const |
const MSLane * | getLane () 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 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. More... | |
void | setDescription (const std::string &description) |
virtual | ~MSMoveReminder () |
Destructor. More... | |
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. More... | |
virtual bool | notifyMove (SUMOTrafficObject &veh, double oldPos, double newPos, double newSpeed) |
Checks whether the reminder still has to be notified about the vehicle moves. More... | |
virtual bool | notifyLeave (SUMOTrafficObject &veh, double lastPos, Notification reason, const MSLane *enteredLane=0) |
Called if the vehicle leaves the reminder's lane. More... | |
void | updateDetector (SUMOTrafficObject &veh, double entryPos, double leavePos, SUMOTime entryTime, SUMOTime currentTime, SUMOTime leaveTime, bool cleanUp) |
Protected Member Functions | |
void | removeFromVehicleUpdateValues (SUMOTrafficObject &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 | |
MSMoveReminder & | operator= (const MSMoveReminder &) |
Private Attributes | |
std::map< SUMOTrafficObject *, std::pair< SUMOTime, double > > | myLastVehicleUpdateValues |
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.
Definition at line 64 of file MSMoveReminder.h.
Definition of a vehicle state.
Definition at line 89 of file MSMoveReminder.h.
MSMoveReminder::MSMoveReminder | ( | const std::string & | description, |
MSLane *const | lane = 0 , |
||
const bool | doAdd = true |
||
) |
Constructor.
[in] | lane | Lane on which the reminder will work. |
[in] | doAdd | whether to add the reminder to the lane |
Definition at line 33 of file MSMoveReminder.cpp.
References MSLane::addMoveReminder(), and myLane.
|
inlinevirtual |
Destructor.
Definition at line 76 of file MSMoveReminder.h.
|
inline |
Definition at line 228 of file MSMoveReminder.h.
References myDescription, and removeFromVehicleUpdateValues().
Referenced by MSBaseVehicle::getRNG(), MSE3Collector::MSE3EntryReminder::notifyEnter(), MSE3Collector::MSE3LeaveReminder::notifyEnter(), MSE3Collector::MSE3EntryReminder::notifyLeave(), MSE3Collector::MSE3LeaveReminder::notifyLeave(), MSE3Collector::MSE3EntryReminder::notifyMove(), MSE3Collector::MSE3LeaveReminder::notifyMove(), MSMeanData_Net::MSLaneMeanDataValues::notifyMoveInternal(), and MSMeanData_Net::MSLaneMeanDataValues::write().
|
inline |
Returns the lane the reminder works on.
Definition at line 83 of file MSMoveReminder.h.
References myLane.
Referenced by libsumo::LaneArea::getLaneID(), libsumo::InductionLoop::getLaneID(), GUIInstantInductLoop::MyWrapper::getParameterWindow(), GUIE2Collector::MyWrapper::getParameterWindow(), GUIInductLoop::MyWrapper::getParameterWindow(), libsumo::InductionLoop::getTree(), GUIInstantInductLoop::MyWrapper::MyWrapper(), GUIInductLoop::MyWrapper::MyWrapper(), MSMeanData_Amitran::MSLaneMeanDataValues::notifyEnter(), MSMeanData_Net::MSLaneMeanDataValues::notifyEnter(), MSDevice_Tripinfo::notifyEnter(), MSMeanData_Net::MSLaneMeanDataValues::notifyLeave(), MSDevice_Tripinfo::notifyLeave(), MSMeanData::MeanDataValues::notifyMove(), libsumo::InductionLoop::storeShape(), and MSMeanData::writeEdge().
|
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.
[in] | veh | The entering vehicle. |
[in] | reason | how the vehicle enters the lane |
Reimplemented in MSDevice_SSM, MSE2Collector, MSMeanData::MeanDataValueTracker, MSE3Collector::MSE3LeaveReminder, MSCalibrator::VehicleRemover, MSTriggeredRerouter, MSDevice_Tripinfo, MSDevice_Routing, MSMeanData_Net::MSLaneMeanDataValues, MSInductLoop, MSMeanData_Amitran::MSLaneMeanDataValues, MSDevice_Bluelight, MSDevice_BTreceiver, MSDevice_Example, MSDevice_BTsender, MSMeanData::MeanDataValues, MSDevice_Vehroutes, MSRouteProbe, MSE3Collector::MSE3EntryReminder, MSDevice_Transportable, and MSDevice_FCD.
Definition at line 128 of file MSMoveReminder.h.
References UNUSED_PARAMETER.
|
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.
[in] | veh | The leaving vehicle. |
[in] | lastPos | Position on the lane when leaving. |
[in] | reason | how the vehicle leaves the lane |
Reimplemented in MSDevice_SSM, MSE2Collector, MSMeanData::MeanDataValueTracker, MSE3Collector::MSE3LeaveReminder, MSTriggeredRerouter, MSInductLoop, MSDevice_Tripinfo, MSDevice_BTreceiver, MSDevice_BTsender, MSMeanData::MeanDataValues, MSE3Collector::MSE3EntryReminder, MSDevice_Bluelight, MSDevice_Example, MSInstantInductLoop, MSDevice_Vehroutes, MSMeanData_Net::MSLaneMeanDataValues, and MSDevice_Transportable.
Definition at line 174 of file MSMoveReminder.h.
References UNUSED_PARAMETER, and updateDetector().
|
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.
[in] | veh | Vehicle that asks this reminder. |
[in] | oldPos | Position before move. |
[in] | newPos | Position after move with newSpeed. |
[in] | newSpeed | Moving speed. |
Reimplemented in MSDevice_SSM, MSE2Collector, MSE3Collector::MSE3LeaveReminder, MSDevice_ToC, MSTriggeredRerouter, MSInductLoop, MSDevice_BTreceiver, MSDevice_BTsender, MSMeanData::MeanDataValues, MSDevice_Tripinfo, MSE3Collector::MSE3EntryReminder, MSDevice_Emissions, MSInstantInductLoop, MSDevice_Bluelight, MSDevice_Example, MSDevice_Battery, and MSDevice_Transportable.
Definition at line 149 of file MSMoveReminder.h.
References UNUSED_PARAMETER.
|
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.
[in] | veh | Vehicle that asks this reminder. |
[in] | frontOnLane | time the front of the vehicle spent on the lane. |
[in] | timeOnLane | time some part of the vehicle spent on the lane. |
[in] | meanSpeedFrontOnLane | Average speed for the time that the front is on the lane. |
[in] | meanSpeedVehicleOnLane | Average speed for the time that the vehicle is on the lane (with front or back). |
[in] | travelledDistanceFrontOnLane | distance travelled while overlapping with the lane. |
[in] | travelledDistanceVehicleOnLane | distance travelled while front was on the lane. |
[in] | meanLengthOnLane | the average length of the vehicle's part on the lane during the last step (==complete length in meso case) |
Reimplemented in MSMeanData::MeanDataValueTracker, MSDevice_Tripinfo, MSDevice_Transportable, MSMeanData_Net::MSLaneMeanDataValues, MSMeanData_Amitran::MSLaneMeanDataValues, MSMeanData_Harmonoise::MSLaneMeanDataValues, and MSMeanData_Emissions::MSLaneMeanDataValues.
Definition at line 206 of file MSMoveReminder.h.
References UNUSED_PARAMETER.
Referenced by MSMeanData::MeanDataValues::notifyMove(), and updateDetector().
|
private |
|
protected |
Definition at line 86 of file MSMoveReminder.cpp.
References myLastVehicleUpdateValues.
Referenced by getDescription(), MSMeanData_Net::MSLaneMeanDataValues::notifyLeave(), and updateDetector().
|
inline |
Definition at line 224 of file MSMoveReminder.h.
References myDescription.
Referenced by MSMeanData::init(), MEInductLoop::MEInductLoop(), METriggeredCalibrator::METriggeredCalibrator(), and MSCalibrator::MSCalibrator().
void MSMoveReminder::updateDetector | ( | SUMOTrafficObject & | veh, |
double | entryPos, | ||
double | leavePos, | ||
SUMOTime | entryTime, | ||
SUMOTime | currentTime, | ||
SUMOTime | leaveTime, | ||
bool | cleanUp | ||
) |
Definition at line 44 of file MSMoveReminder.cpp.
References myLastVehicleUpdateValues, notifyMoveInternal(), removeFromVehicleUpdateValues(), and STEPS2TIME.
Referenced by notifyLeave(), and MEVehicle::updateDetectorForWriting().
|
protected |
a description of this moveReminder
Definition at line 240 of file MSMoveReminder.h.
Referenced by getDescription(), and setDescription().
|
protected |
Lane on which the reminder works.
Definition at line 238 of file MSMoveReminder.h.
Referenced by MSE2Collector::getEstimatedCurrentVehicleNumber(), MSE2Collector::getEstimateQueueLength(), getLane(), MSMoveReminder(), MSE3Collector::MSE3EntryReminder::notifyEnter(), MSInductLoop::notifyEnter(), MSE3Collector::MSE3LeaveReminder::notifyEnter(), MSE2Collector::notifyEnter(), MSE3Collector::MSE3EntryReminder::notifyLeave(), MSE3Collector::MSE3LeaveReminder::notifyLeave(), MSE2Collector::notifyLeave(), MSE3Collector::MSE3EntryReminder::notifyMove(), MSMeanData::MeanDataValues::notifyMove(), MSE3Collector::MSE3LeaveReminder::notifyMove(), MSE2Collector::notifyMove(), and MSMeanData::MeanDataValueTracker::reset().
|
private |
Definition at line 243 of file MSMoveReminder.h.
Referenced by removeFromVehicleUpdateValues(), and updateDetector().