86 virtual void reset(
bool afterWrite =
false) = 0;
163 const int numVehicles = -1)
const = 0;
198 const std::set<std::string>*
const vTypes = 0,
206 void reset(
bool afterWrite);
267 const int numVehicles = -1)
const;
321 const bool useLanes,
const bool withEmpty,
322 const bool printDefaults,
const bool withInternal,
323 const bool trackVehicles,
const SUMOReal minSamples,
325 const std::set<std::string> vTypes);
410 const SumoXMLTag tag,
const std::string
id)
const;
Data collector for edges/lanes.
virtual ~MeanDataValueTracker()
Destructor.
virtual MSMeanData::MeanDataValues * createValues(MSLane *const lane, const SUMOReal length, const bool doAdd) const =0
Create an instance of MeanDataValues.
SumoXMLTag
Numbers representing SUMO-XML - element names.
const SUMOReal myLaneLength
The length of the lane / edge the data collector is on.
std::vector< std::vector< MeanDataValues * > > myMeasures
Value collectors; sorted by edge, then by lane.
MeanDataValues(MSLane *const lane, const SUMOReal length, const bool doAdd, const std::set< std::string > *const vTypes=0)
Constructor.
const bool myDumpInternal
Whether internal lanes/edges shall be written.
const std::set< std::string > *const myVehicleTypes
The vehicle types to look for (0 or empty means all)
SUMOReal travelledDistance
The sum of the distances the vehicles travelled.
const SUMOReal myMaxTravelTime
the maximum travel time to write
Notification
Definition of a vehicle state.
MeanDataValues * myValues
The number of vehicles which left in the current interval.
bool notifyEnter(SUMOVehicle &veh, MSMoveReminder::Notification reason)
Computes current values and adds them to their sums.
const std::set< std::string > myVehicleTypes
The vehicle types to look for (empty means all)
MSMeanData & operator=(const MSMeanData &)
Invalidated assignment operator.
bool writePrefix(OutputDevice &dev, const MeanDataValues &values, const SumoXMLTag tag, const std::string id) const
Checks for emptiness and writes prefix into the given stream.
const MSMeanData * myParent
The meandata parent.
TrackerEntry(MeanDataValues *const values)
Constructor.
std::list< TrackerEntry * > myCurrentData
The currently active meandata "intervals".
A road/street connecting two junctions.
const bool myPrintDefaults
Whether empty lanes/edges shall be written.
MeanDataValueTracker(MSLane *const lane, const SUMOReal length, const std::set< std::string > *const vTypes=0, const MSMeanData *const parent=0)
Constructor.
virtual bool notifyLeave(SUMOVehicle &veh, SUMOReal lastPos, MSMoveReminder::Notification reason)
Called if the vehicle leaves the reminder's lane.
int myNumVehicleLeft
The number of vehicles which left in the current interval.
Representation of a vehicle.
Data structure for mean (aggregated) edge/lane values.
const bool myAmEdgeBased
Information whether the output shall be edge-based (not lane-based)
virtual bool notifyEnter(SUMOVehicle &veh, MSMoveReminder::Notification reason)
Called if the vehicle enters the reminder's lane.
virtual bool isEmpty() const
Returns whether any data was collected.
size_t getNumReady() const
void writeXMLDetectorProlog(OutputDevice &dev) const
Opens the XML-output using "netstats" as root element.
virtual void write(OutputDevice &dev, const SUMOTime period, const SUMOReal numLanes, const SUMOReal defaultTravelTime, const int numVehicles=-1) const =0
Writes output values into the given stream.
Something on a lane to be noticed about vehicle movement.
const SUMOTime myDumpBegin
The first and the last time step to write information (-1 indicates always)
virtual ~MSMeanData()
Destructor.
bool notifyMove(SUMOVehicle &veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed)
Checks whether the reminder still has to be notified about the vehicle moves.
const SUMOReal myMinSamples
the minimum sample seconds
void notifyMoveInternal(SUMOVehicle &veh, SUMOReal timeOnLane, SUMOReal speed)
Internal notification about the vehicle moves.
bool isEmpty() const
Returns whether any data was collected.
virtual void addTo(MeanDataValues &val) const =0
Add the values of this to the given one and store them there.
MSMeanData(const std::string &id, const SUMOTime dumpBegin, const SUMOTime dumpEnd, const bool useLanes, const bool withEmpty, const bool printDefaults, const bool withInternal, const bool trackVehicles, const SUMOReal minSamples, const SUMOReal maxTravelTime, const std::set< std::string > vTypes)
Constructor.
void addTo(MSMeanData::MeanDataValues &val) const
Add the values of this to the given one and store them there.
virtual ~MeanDataValues()
Destructor.
void writeXMLOutput(OutputDevice &dev, SUMOTime startTime, SUMOTime stopTime)
Writes collected values into the given stream.
virtual void reset(bool afterWrite=false)=0
Resets values so they may be used for the next interval.
std::list< std::pair< SUMOTime, SUMOTime > > myPendingIntervals
The intervals for which output still has to be generated (only in the tracking case) ...
std::vector< MSEdge * > myEdges
The corresponding first edges.
void writeEdge(OutputDevice &dev, const std::vector< MeanDataValues * > &edgeValues, MSEdge *edge, SUMOTime startTime, SUMOTime stopTime)
Writes edge values into the given stream.
virtual void update()
Called if a per timestep update is needed. Default does nothing.
int myNumVehicleEntered
The number of vehicles which entered in the current interval.
std::map< SUMOVehicle *, TrackerEntry * > myTrackedData
The map of vehicles to data entries.
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.
virtual void detectorUpdate(const SUMOTime step)
Updates the detector.
SUMOReal getSamples() const
Returns the number of collected sample seconds.
Static storage of an output device and its base (abstract) implementation.
virtual SUMOReal getSamples() const
Returns the number of collected sample seconds.
bool vehicleApplies(const SUMOVehicle &veh) const
Tests whether the vehicles type is to be regarded.
void resetOnly(SUMOTime stopTime)
Resets network value in order to allow processing of the next interval.
const bool myDumpEmpty
Whether empty lanes/edges shall be written.
Data structure for mean (aggregated) edge/lane values for tracked vehicles.
const bool myTrackVehicles
Whether vehicles are tracked.
Representation of a lane in the micro simulation.
Base of value-generating classes (detectors)
bool notifyLeave(SUMOVehicle &veh, SUMOReal lastPos, MSMoveReminder::Notification reason)
Called if the vehicle leaves the reminder's lane.
void init()
Adds the value collectors to all relevant edges.
void reset(bool afterWrite)
Resets values so they may be used for the next interval.