77 virtual void reset(
bool afterWrite =
false) = 0;
111 double newPos,
double newSpeed);
145 const double numLanes,
const double speedLimit,
const double defaultTravelTime,
146 const int numVehicles = -1)
const = 0;
203 void reset(
bool afterWrite);
217 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);
256 const double numLanes,
const double speedLimit,
const double defaultTravelTime,
257 const int numVehicles = -1)
const;
314 const bool useLanes,
const bool withEmpty,
315 const bool printDefaults,
const bool withInternal,
317 const double minSamples,
318 const double maxTravelTime,
319 const std::string& vTypes,
320 const std::string& writeAttributes,
321 const std::vector<MSEdge*>& edges,
378 return std::vector<std::string>();
458 const SumoXMLTag tag,
const std::string
id)
const;
481 static long long int initWrittenAttributes(
const std::string writeAttributes,
const std::string&
id);
std::vector< MSEdge * > MSEdgeVector
std::vector< MSEdge * > MSEdgeVector
SumoXMLTag
Numbers representing SUMO-XML - element names.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
#define UNUSED_PARAMETER(x)
Base of value-generating classes (detectors)
bool detectPersons() const
A road/street connecting two junctions.
Representation of a lane in the micro simulation.
MeanDataValues * myValues
The number of vehicles which left in the current interval.
virtual ~TrackerEntry()
Constructor.
int myNumVehicleEntered
The number of vehicles which entered in the current interval.
TrackerEntry(MeanDataValues *const values)
Constructor.
int myNumVehicleLeft
The number of vehicles which left in the current interval.
Data structure for mean (aggregated) edge/lane values for tracked vehicles.
double getSamples() const
Returns the number of collected sample seconds.
MeanDataValueTracker(MSLane *const lane, const double length, const MSMeanData *const parent)
Constructor.
bool notifyLeave(SUMOTrafficObject &veh, double lastPos, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Called if the vehicle leaves the reminder's lane.
void addTo(MSMeanData::MeanDataValues &val) const
Add the values of this to the given one and store them there.
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.
virtual ~MeanDataValueTracker()
Destructor.
bool notifyEnter(SUMOTrafficObject &veh, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Computes current values and adds them to their sums.
std::list< TrackerEntry * > myCurrentData
The currently active meandata "intervals".
bool isEmpty() const
Returns whether any data was collected.
void reset(bool afterWrite)
Resets values so they may be used for the next interval.
void write(OutputDevice &dev, long long int attributeMask, const SUMOTime period, const double numLanes, const double speedLimit, const double defaultTravelTime, const int numVehicles=-1) const
Writes output values into the given stream.
std::map< const SUMOTrafficObject *, TrackerEntry * > myTrackedData
The map of vehicles to data entries.
Data structure for mean (aggregated) edge/lane values.
virtual void addTo(MeanDataValues &val) const =0
Add the values of this to the given one and store them there.
virtual void write(OutputDevice &dev, long long int attributeMask, const SUMOTime period, const double numLanes, const double speedLimit, const double defaultTravelTime, const int numVehicles=-1) const =0
Writes output values into the given stream.
virtual bool notifyLeave(SUMOTrafficObject &veh, double lastPos, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Called if the vehicle leaves the reminder's lane.
MeanDataValues(MSLane *const lane, const double length, const bool doAdd, const MSMeanData *const parent)
Constructor.
double getTravelledDistance() const
Returns the total travelled distance.
virtual void update()
Called if a per timestep update is needed. Default does nothing.
double travelledDistance
The sum of the distances the vehicles travelled.
virtual bool isEmpty() const
Returns whether any data was collected.
bool notifyMove(SUMOTrafficObject &veh, double oldPos, double newPos, double newSpeed)
Checks whether the reminder still has to be notified about the vehicle moves.
const double myLaneLength
The length of the lane / edge the data collector is on.
virtual ~MeanDataValues()
Destructor.
virtual double getAttributeValue(SumoXMLAttr a, const SUMOTime period, const double numLanes, const double speedLimit) const
return attribute value
virtual void reset(bool afterWrite=false)=0
Resets values so they may be used for the next interval.
virtual bool notifyEnter(SUMOTrafficObject &veh, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Called if the vehicle enters the reminder's lane.
const MSMeanData *const myParent
The meandata parent.
virtual double getSamples() const
Returns the number of collected sample seconds.
Data collector for edges/lanes.
virtual double getAttributeValue(const MSLane *lane, SumoXMLAttr a, double defaultValue) const
return attribute value for the given lane
virtual MSMeanData::MeanDataValues * createValues(MSLane *const lane, const double length, const bool doAdd) const =0
Create an instance of MeanDataValues.
double getMaxTravelTime() const
const bool myAggregate
whether the data for all edges shall be aggregated
void writeXMLOutput(OutputDevice &dev, SUMOTime startTime, SUMOTime stopTime)
Writes collected values into the given stream.
void writeEdge(OutputDevice &dev, const std::vector< MeanDataValues * > &edgeValues, MSEdge *edge, SUMOTime startTime, SUMOTime stopTime)
Writes edge values into the given stream.
const bool myDumpInternal
Whether internal lanes/edges shall be written.
virtual std::vector< std::string > getAttributeNames() const
return all attributes that are (potentially) written by this output
const SUMOTime myDumpBegin
The first and the last time step to write information (-1 indicates always)
virtual void detectorUpdate(const SUMOTime step)
Updates the detector.
virtual ~MSMeanData()
Destructor.
double getMinSamples() const
void writeAggregated(OutputDevice &dev, SUMOTime startTime, SUMOTime stopTime)
Writes aggregate of all edge values into the given stream.
void init()
Adds the value collectors to all relevant edges.
const double myMinSamples
the minimum sample seconds
void resetOnly(SUMOTime stopTime)
Resets network value in order to allow processing of the next interval.
const long long int myWrittenAttributes
bit mask for checking attributes to be written
const bool myPrintDefaults
Whether empty lanes/edges shall be written.
MSMeanData(const MSMeanData &)
Invalidated copy constructor.
std::map< const MSEdge *, int > myEdgeIndex
The index in myEdges / myMeasures.
const bool myAmEdgeBased
Information whether the output shall be edge-based (not lane-based)
SUMOTime myInitTime
time at which init was called();
const double myMaxTravelTime
the maximum travel time to write
std::list< std::pair< SUMOTime, SUMOTime > > myPendingIntervals
The intervals for which output still has to be generated (only in the tracking case)
const std::vector< MeanDataValues * > * getEdgeValues(const MSEdge *edge) const
virtual std::string getEdgeID(const MSEdge *const edge)
Return the relevant edge id.
MSMeanData & operator=(const MSMeanData &)
Invalidated assignment operator.
static long long int initWrittenAttributes(const std::string writeAttributes, const std::string &id)
virtual void writeXMLDetectorProlog(OutputDevice &dev) const
Opens the XML-output using "netstats" as root element.
const bool myDumpEmpty
Whether empty lanes/edges shall be written.
MSEdgeVector myEdges
The corresponding first edges.
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 int detectPersons, const double minSamples, const double maxTravelTime, const std::string &vTypes, const std::string &writeAttributes, const std::vector< MSEdge * > &edges, bool aggregate)
Constructor.
virtual void openInterval(OutputDevice &dev, const SUMOTime startTime, const SUMOTime stopTime)
Writes the interval opener.
std::vector< std::vector< MeanDataValues * > > myMeasures
Value collectors; sorted by edge, then by lane.
virtual 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 bool myTrackVehicles
Whether vehicles are tracked.
Something on a lane to be noticed about vehicle movement.
Notification
Definition of a vehicle state.
Static storage of an output device and its base (abstract) implementation.
Representation of a vehicle, person, or container.