SUMO - Simulation of Urban MObility
|
Data structure for mean (aggregated) edge/lane values for tracked vehicles. More...
#include <MSMeanData.h>
Data Structures | |
class | TrackerEntry |
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 | |
void | addTo (MSMeanData::MeanDataValues &val) const |
Add the values of this to the given one and store them there. More... | |
void | clearFirst () |
const std::string & | getDescription () const |
const MSLane * | getLane () const |
Returns the lane the reminder works on. More... | |
size_t | getNumReady () const |
SUMOReal | getSamples () const |
Returns the number of collected sample seconds. More... | |
bool | isEmpty () const |
Returns whether any data was collected. More... | |
MeanDataValueTracker (MSLane *const lane, const SUMOReal length, const std::set< std::string > *const vTypes=0, const MSMeanData *const parent=0) | |
Constructor. More... | |
bool | notifyMove (SUMOVehicle &veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed) |
Checks whether the reminder still has to be notified about the vehicle moves. More... | |
void | reset (bool afterWrite) |
Resets values so they may be used for the next interval. More... | |
void | setDescription (const std::string &description) |
virtual void | update () |
Called if a per timestep update is needed. Default does nothing. More... | |
bool | vehicleApplies (const SUMOVehicle &veh) const |
Tests whether the vehicles type is to be regarded. More... | |
void | write (OutputDevice &dev, const SUMOTime period, const SUMOReal numLanes, const SUMOReal defaultTravelTime, const int numVehicles=-1) const |
Writes output values into the given stream. More... | |
virtual | ~MeanDataValueTracker () |
Destructor. More... | |
Methods inherited from MSMoveReminder | |
void | notifyMoveInternal (SUMOVehicle &veh, SUMOReal timeOnLane, SUMOReal speed) |
Internal notification about the vehicle moves. More... | |
bool | notifyLeave (SUMOVehicle &veh, SUMOReal lastPos, MSMoveReminder::Notification reason) |
Called if the vehicle leaves the reminder's lane. More... | |
bool | notifyEnter (SUMOVehicle &veh, MSMoveReminder::Notification reason) |
Computes current values and adds them to their sums. More... | |
Protected Attributes | |
std::string | myDescription |
a description of this moveReminder More... | |
MSLane *const | myLane |
Lane on which the reminder works. More... | |
const SUMOReal | myLaneLength |
The length of the lane / edge the data collector is on. More... | |
Private Attributes | |
std::list< TrackerEntry * > | myCurrentData |
The currently active meandata "intervals". More... | |
const MSMeanData * | myParent |
The meandata parent. More... | |
std::map< SUMOVehicle *, TrackerEntry * > | myTrackedData |
The map of vehicles to data entries. More... | |
Collected values | |
SUMOReal | sampleSeconds |
SUMOReal | travelledDistance |
The sum of the distances the vehicles travelled. More... | |
Data structure for mean (aggregated) edge/lane values for tracked vehicles.
Definition at line 194 of file MSMeanData.h.
|
inherited |
Definition of a vehicle state.
Definition at line 94 of file MSMoveReminder.h.
MSMeanData::MeanDataValueTracker::MeanDataValueTracker | ( | MSLane *const | lane, |
const SUMOReal | length, | ||
const std::set< std::string > *const | vTypes = 0 , |
||
const MSMeanData *const | parent = 0 |
||
) |
Constructor.
Definition at line 144 of file MSMeanData.cpp.
References MSMeanData::createValues(), and myCurrentData.
|
virtual |
Destructor.
Definition at line 153 of file MSMeanData.cpp.
|
virtual |
Add the values of this to the given one and store them there.
[in] | val | The meandata to add to |
Implements MSMeanData::MeanDataValues.
Definition at line 168 of file MSMeanData.cpp.
void MSMeanData::MeanDataValueTracker::clearFirst | ( | ) |
|
inlineinherited |
Definition at line 213 of file MSMoveReminder.h.
References MSMoveReminder::myDescription.
|
inlineinherited |
Returns the lane the reminder works on.
Definition at line 88 of file MSMoveReminder.h.
References MSMoveReminder::myLane.
Referenced by MSE2Collector::detectorUpdate(), TraCIServerAPI_InductionLoop::getPosition(), TraCIServerAPI_InductionLoop::getTree(), GUIInstantInductLoop::MyWrapper::MyWrapper(), GUI_E2_ZS_Collector::MyWrapper::MyWrapper(), GUIInductLoop::MyWrapper::MyWrapper(), MSDevice_BTreceiver::notifyEnter(), MSDevice_Tripinfo::notifyEnter(), MSDevice_BTsender::notifyEnter(), MSDevice_Tripinfo::notifyLeave(), MSDevice_BTreceiver::notifyLeave(), MSDevice_BTsender::notifyLeave(), MSDevice_BTreceiver::notifyMove(), MSDevice_BTsender::notifyMove(), TraCIServerAPI_InductionLoop::processGet(), and MSMeanData::writeEdge().
size_t MSMeanData::MeanDataValueTracker::getNumReady | ( | ) | const |
Definition at line 226 of file MSMeanData.cpp.
|
virtual |
Returns the number of collected sample seconds.
Reimplemented from MSMeanData::MeanDataValues.
Definition at line 240 of file MSMeanData.cpp.
|
virtual |
Returns whether any data was collected.
Reimplemented from MSMeanData::MeanDataValues.
Definition at line 208 of file MSMeanData.cpp.
|
virtual |
Computes current values and adds them to their sums.
The fraction of time the vehicle is on the lane is computed and used as a weight for the vehicle's current values. The "emitted" field is incremented, additionally.
[in] | veh | The entering vehicle. |
[in] | reason | how the vehicle enters the lane |
Reimplemented from MSMeanData::MeanDataValues.
Definition at line 189 of file MSMeanData.cpp.
References MSMoveReminder::NOTIFICATION_SEGMENT.
|
virtual |
Called if the vehicle leaves the reminder's lane.
veh | The leaving vehicle. | |
[in] | lastPos | Position on the lane when leaving. |
[in] | isArrival | whether the vehicle arrived at its destination |
[in] | isLaneChange | whether the vehicle changed from the lane |
Reimplemented from MSMeanData::MeanDataValues.
Definition at line 180 of file MSMeanData.cpp.
References MSMoveReminder::NOTIFICATION_SEGMENT.
|
virtualinherited |
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 from MSMoveReminder.
Definition at line 84 of file MSMeanData.cpp.
References SUMOVehicle::getID(), MSVehicleType::getLength(), SUMOVehicle::getVehicleType(), SUMOVehicle::hasArrived(), SUMOReal, TS, and WRITE_ERROR.
|
virtual |
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] | timeOnLane | time the vehicle spent on the lane. |
[in] | speed | Moving speed. |
Reimplemented from MSMoveReminder.
Definition at line 174 of file MSMeanData.cpp.
|
virtual |
Resets values so they may be used for the next interval.
Implements MSMeanData::MeanDataValues.
Definition at line 158 of file MSMeanData.cpp.
|
inlineinherited |
Definition at line 209 of file MSMoveReminder.h.
References MSMoveReminder::myDescription.
Referenced by MSCalibrator::MSCalibrator().
|
virtualinherited |
Called if a per timestep update is needed. Default does nothing.
Reimplemented in MSMeanData_Harmonoise::MSLaneMeanDataValues.
Definition at line 131 of file MSMeanData.cpp.
|
inherited |
Tests whether the vehicles type is to be regarded.
[in] | veh | The regarded vehicle |
Definition at line 118 of file MSMeanData.cpp.
References MSVehicleType::getID(), SUMOVehicle::getVehicleType(), and MSMeanData::myVehicleTypes.
|
virtual |
Writes output values into the given stream.
[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 |
IOError | If an error on writing occurs (!!! not yet implemented) |
Implements MSMeanData::MeanDataValues.
Definition at line 214 of file MSMeanData.cpp.
|
private |
The currently active meandata "intervals".
Definition at line 296 of file MSMeanData.h.
Referenced by MeanDataValueTracker().
|
protectedinherited |
a description of this moveReminder
Definition at line 222 of file MSMoveReminder.h.
Referenced by MSMoveReminder::getDescription(), and MSMoveReminder::setDescription().
|
protectedinherited |
Lane on which the reminder works.
Definition at line 220 of file MSMoveReminder.h.
Referenced by MSE2Collector::detectorUpdate(), MSMoveReminder::getLane(), MSE2Collector::MSE2Collector(), and MSMoveReminder::MSMoveReminder().
|
protectedinherited |
The length of the lane / edge the data collector is on.
Definition at line 172 of file MSMeanData.h.
|
private |
The meandata parent.
Definition at line 299 of file MSMeanData.h.
|
private |
The map of vehicles to data entries.
Definition at line 293 of file MSMeanData.h.
|
protectedinherited |
Definition at line 177 of file MSMeanData.h.
Referenced by MSMeanData_Harmonoise::MSLaneMeanDataValues::addTo(), MSMeanData_HBEFA::MSLaneMeanDataValues::addTo(), and MSMeanData_Net::MSLaneMeanDataValues::addTo().
|
inherited |
The sum of the distances the vehicles travelled.
Definition at line 180 of file MSMeanData.h.
Referenced by MSMeanData_Harmonoise::MSLaneMeanDataValues::addTo(), MSMeanData_HBEFA::MSLaneMeanDataValues::addTo(), MSMeanData_Net::MSLaneMeanDataValues::addTo(), and MSCalibrator::writeXMLOutput().