MSE3Collector::MSE3LeaveReminder Class Reference

#include <MSE3Collector.h>

Inheritance diagram for MSE3Collector::MSE3LeaveReminder:

MSMoveReminder

Detailed Description

A place on the road net (at a certain lane and position on it) where the E3-area ends.

Definition at line 134 of file MSE3Collector.h.


Public Member Functions

const MSLane *const getLane () const throw ()
 Returns the lane the reminder works on.
 MSE3LeaveReminder (const MSCrossSection &crossSection, MSE3Collector &collector) throw ()
 Constructor.
methods from MSMoveReminder
bool isStillActive (MSVehicle &veh, SUMOReal, SUMOReal newPos, SUMOReal) throw ()
 Checks whether the vehicle leaves.
bool notifyEnter (MSVehicle &veh, bool isEmit, bool isLaneChange) throw ()
 Returns whether the vehicle shall be aware of this entry.
Interface methods, to be derived by subclasses
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.

Private Member Functions

 MSE3LeaveReminder (const MSE3LeaveReminder &)
 Invalidated copy constructor.
MSE3LeaveReminderoperator= (const MSE3LeaveReminder &)
 Invalidated assignment operator.

Private Attributes

MSE3CollectormyCollector
 The parent collector.
SUMOReal myPosition
 The position on the lane.

Constructor & Destructor Documentation

MSE3Collector::MSE3LeaveReminder::MSE3LeaveReminder ( const MSCrossSection crossSection,
MSE3Collector collector 
) throw ()

Constructor.

Parameters:
[in] crossSection The position at which the exit lies
[in] collector The detector the exit belongs to

Definition at line 82 of file MSE3Collector.cpp.

Referenced by MSE3Collector::MSE3Collector().

00084         : MSMoveReminder(crossSection.myLane),
00085         myCollector(collector), myPosition(crossSection.myPosition) {}

MSE3Collector::MSE3LeaveReminder::MSE3LeaveReminder ( const MSE3LeaveReminder  )  [private]

Invalidated copy constructor.


Member Function Documentation

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

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

Checks whether the vehicle leaves.

As soon as the reported vehicle leaves the detector area (position-length>myPosition) the leaving time is computed and both are made known to the parent detector using "leave".

Parameters:
[in] veh The vehicle in question.
[in] oldPos Position before the move-micro-timestep.
[in] newPos Position after the move-micro-timestep.
[in] newSpeed Unused here.
Returns:
False, if vehicle passed the detector entierly, else true.
See also:
MSMoveReminder

MSMoveReminder::isStillActive

MSE3Collector::leave

Reimplemented from MSMoveReminder.

Definition at line 89 of file MSE3Collector.cpp.

References MSNet::getCurrentTimeStep(), MSNet::getInstance(), MSE3Collector::leave(), MSE3Collector::MSE3EntryReminder::myCollector, MSE3Collector::MSE3EntryReminder::myPosition, and SUMOReal.

00090                                                     {
00091     if (newPos <= myPosition) {
00092         // crossSection not yet reached
00093         return true;
00094     }
00095     if (oldPos > myPosition) {
00096         // crossSection was not passed
00097         return false;
00098     }
00099     // crossSection left
00100     SUMOReal leaveTimestep = (SUMOReal) MSNet::getInstance()->getCurrentTimeStep();
00101     leaveTimestep += (((myPosition - oldPos) / newSpeed) * (SUMOReal) 1000.);
00102     myCollector.leave(veh, leaveTimestep / (SUMOReal) 1000.);
00103     return false;
00104 }

bool MSE3Collector::MSE3LeaveReminder::notifyEnter ( MSVehicle veh,
bool  isEmit,
bool  isLaneChange 
) throw () [virtual]

Returns whether the vehicle shall be aware of this entry.

Returns true if the vehicle is in front of the exit, so that it may enter it in later steps.

Parameters:
[in] veh The vehicle that enters the lane
[in] isEmit whether the vehicle was just emitted into the net
[in] isLaneChange whether the vehicle changed to the lane
See also:
MSMoveReminder::notifyEnter
Returns:
False, if vehicle passed the exit completely, else true.

Reimplemented from MSMoveReminder.

Definition at line 108 of file MSE3Collector.cpp.

References MSVehicleType::getLength(), MSVehicle::getPositionOnLane(), MSVehicle::getVehicleType(), and myPosition.

00108                                                                               {
00109     return veh.getPositionOnLane() - veh.getVehicleType().getLength() <= myPosition;
00110 }

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

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 {};

MSE3LeaveReminder& MSE3Collector::MSE3LeaveReminder::operator= ( const MSE3LeaveReminder  )  [private]

Invalidated assignment operator.


Field Documentation

The parent collector.

Definition at line 182 of file MSE3Collector.h.

MSLane* const MSMoveReminder::myLane [protected, inherited]

The position on the lane.

Definition at line 185 of file MSE3Collector.h.

Referenced by notifyEnter().


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

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