MSMeanData::MeanDataValues Class Reference

#include <MSMeanData.h>

Inheritance diagram for MSMeanData::MeanDataValues:

MSMoveReminder MSMeanData::MeanDataValueTracker MSMeanData_Harmonoise::MSLaneMeanDataValues MSMeanData_HBEFA::MSLaneMeanDataValues MSMeanData_Net::MSLaneMeanDataValues

Detailed Description

Data structure for mean (aggregated) edge/lane values.

Structure holding values that describe the emissions aggregated over some seconds.

Definition at line 74 of file MSMeanData.h.


Collected values

The number of sampled vehicle movements (in s)

SUMOReal sampleSeconds
SUMOReal travelledDistance
 The sum of the distances the vehicles travelled.

Public Member Functions

virtual void addTo (MeanDataValues &val) const =0 throw ()
 Add the values of this to the given one and store them there.
const MSLane *const getLane () const throw ()
 Returns the lane the reminder works on.
virtual SUMOReal getSamples () const throw ()
virtual bool isEmpty () const throw ()
 Returns whether any data was collected.
 MeanDataValues (MSLane *const lane, const bool doAdd, const std::set< std::string > *const vTypes=0) throw ()
 Constructor.
virtual void reset ()=0 throw ()
 Resets values so they may be used for the next interval.
virtual void update () throw ()
 Called if a per timestep update is needed. Default does nothing.
virtual void write (OutputDevice &dev, const SUMOTime period, const SUMOReal numLanes, const SUMOReal length, const int numVehicles=-1) const =0 throw (IOError)
 Writes output values into the given stream.
virtual ~MeanDataValues () 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.
Methods inherited from MSMoveReminder.
bool vehicleApplies (const SUMOVehicle &veh) const throw ()
 Tests whether the vehicles type is to be regarded.

Protected Attributes

MSLane *const myLane
 Lane on which the reminder works.

Private Attributes

const std::set< std::string >
*const 
myVehicleTypes
 The vehicle types to look for (0 or empty means all).

Constructor & Destructor Documentation

MSMeanData::MeanDataValues::MeanDataValues ( MSLane *const   lane,
const bool  doAdd,
const std::set< std::string > *const   vTypes = 0 
) throw ()

Constructor.

Definition at line 57 of file MSMeanData.cpp.

00058         : MSMoveReminder(lane, doAdd), sampleSeconds(0), travelledDistance(0), myVehicleTypes(vTypes) {}

MSMeanData::MeanDataValues::~MeanDataValues (  )  throw () [virtual]

Destructor.

Definition at line 61 of file MSMeanData.cpp.

00061                                                   {
00062 }


Member Function Documentation

virtual void MSMeanData::MeanDataValues::addTo ( MeanDataValues val  )  const throw () [pure virtual]

Add the values of this to the given one and store them there.

Parameters:
[in] val The meandata to add to

Implemented in MSMeanData::MeanDataValueTracker, MSMeanData_Harmonoise::MSLaneMeanDataValues, MSMeanData_HBEFA::MSLaneMeanDataValues, and MSMeanData_Net::MSLaneMeanDataValues.

Referenced by MSMeanData::writeEdge().

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

SUMOReal MSMeanData::MeanDataValues::getSamples (  )  const throw () [virtual]

Reimplemented in MSMeanData::MeanDataValueTracker.

Definition at line 84 of file MSMeanData.cpp.

References sampleSeconds.

00084                                                    {
00085     return sampleSeconds;
00086 }

bool MSMeanData::MeanDataValues::isEmpty (  )  const throw () [virtual]

Returns whether any data was collected.

Returns:
whether no data was collected

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

Definition at line 73 of file MSMeanData.cpp.

References sampleSeconds.

00073                                                 {
00074     return sampleSeconds == 0;
00075 }

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

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, inherited]

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

virtual void MSMeanData::MeanDataValues::reset (  )  throw () [pure virtual]

void MSMeanData::MeanDataValues::update (  )  throw () [virtual]

Called if a per timestep update is needed. Default does nothing.

Reimplemented in MSMeanData_Harmonoise::MSLaneMeanDataValues.

Definition at line 79 of file MSMeanData.cpp.

00079                                          {
00080 }

bool MSMeanData::MeanDataValues::vehicleApplies ( const SUMOVehicle veh  )  const throw ()

virtual void MSMeanData::MeanDataValues::write ( OutputDevice dev,
const SUMOTime  period,
const SUMOReal  numLanes,
const SUMOReal  length,
const int  numVehicles = -1 
) const throw (IOError) [pure virtual]

Writes output values into the given stream.

Parameters:
[in] dev The output device to write the data into
[in] period Length of the period the data were gathered
[in] numLanes The total number of lanes for which the data was collected
[in] length The length of the object for which the data was collected
Exceptions:
IOError If an error on writing occurs (!!! not yet implemented)

Implemented in MSMeanData::MeanDataValueTracker, MSMeanData_Harmonoise::MSLaneMeanDataValues, MSMeanData_HBEFA::MSLaneMeanDataValues, and MSMeanData_Net::MSLaneMeanDataValues.

Referenced by MSMeanData::writeEdge().


Field Documentation

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

const std::set<std::string>* const MSMeanData::MeanDataValues::myVehicleTypes [private]

The vehicle types to look for (0 or empty means all).

Definition at line 142 of file MSMeanData.h.

Referenced by MSMeanData::init(), and vehicleApplies().


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

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