42 #ifdef CHECK_MEMORY_LEAKS 44 #endif // CHECK_MEMORY_LEAKS 79 for (std::map<const MSVehicleType*, int>::const_iterator it =
typedAmount.begin(); it !=
typedAmount.end(); ++it) {
82 for (std::map<const MSVehicleType*, SUMOReal>::const_iterator it =
typedSamples.begin(); it !=
typedSamples.end(); ++it) {
126 }
else if (defaultTravelTime >= 0.) {
132 for (std::map<const MSVehicleType*, int>::const_iterator it =
typedAmount.begin(); it !=
typedAmount.end(); ++it) {
146 const SUMOTime dumpEnd,
const bool useLanes,
147 const bool withEmpty,
const bool printDefaults,
148 const bool withInternal,
149 const bool trackVehicles,
153 const std::string& vTypes)
154 :
MSMeanData(id, dumpBegin, dumpEnd, useLanes, withEmpty, printDefaults,
155 withInternal, trackVehicles, maxTravelTime, minSamples, vTypes),
165 dev.
writeXMLHeader(
"linkData",
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/amitran/linkdata.xsd\"");
177 const int duration = int(1000 *
STEPS2TIME(stopTime - startTime) + 0.5);
bool notifyEnter(SUMOVehicle &veh, MSMoveReminder::Notification reason)
Computes current values and adds them to their sums.
Data collector for edges/lanes.
const MSLane * getLane() const
Returns the lane the reminder works on.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
SumoXMLTag
Numbers representing SUMO-XML - element names.
const SUMOReal myLaneLength
The length of the lane / edge the data collector is on.
Representation of a vehicle in the micro simulation.
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.
MSMeanData::MeanDataValues * createValues(MSLane *const lane, const SUMOReal length, const bool doAdd) const
Create an instance of MeanDataValues.
bool vehicleApplies(const SUMOVehicle &veh) const
Checks whether the detector measures vehicles of the given type.
Network state mean data collector for edges/lanes.
void notifyMoveInternal(const SUMOVehicle &veh, const SUMOReal, const SUMOReal timeOnLane, const SUMOReal, const SUMOReal meanSpeedVehicleOnLane, const SUMOReal travelledDistanceFrontOnLane, const SUMOReal travelledDistanceVehicleOnLane)
Internal notification about the vehicle moves.
The vehicle arrived at a junction.
SUMOReal travelledDistance
The sum of the distances the vehicles travelled.
Notification
Definition of a vehicle state.
virtual bool isEmpty() const
Returns whether any data was collected.
std::map< const MSVehicleType *, SUMOReal > typedSamples
The number of sampled vehicle movements by type (in s)
int getNumericalID() const
Returns the numerical id of the edge.
Data structure for mean (aggregated) edge/lane values.
bool writeXMLHeader(const std::string &rootElement, const std::string &attrs="", const std::string &comment="")
Writes an XML header with optional configuration.
const SUMOReal myHaltSpeed
the minimum sample seconds
A road/street connecting two junctions.
virtual ~MSMeanData_Amitran()
Destructor.
Representation of a vehicle.
Data structure for mean (aggregated) edge/lane values.
void reset(bool afterWrite=false)
Resets values so they may be used for the next interval.
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
MSMeanData_Amitran(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 maxTravelTime, const SUMOReal minSamples, const SUMOReal haltSpeed, const std::string &vTypes)
Constructor.
virtual void openInterval(OutputDevice &dev, const SUMOTime startTime, const SUMOTime stopTime)
Writes the interval opener.
virtual std::string getEdgeID(const MSEdge *const edge)
Return the relevant edge id.
MSLaneMeanDataValues(MSLane *const lane, const SUMOReal length, const bool doAdd, const MSMeanData_Amitran *parent)
Constructor.
bool isTyped() const
Checks whether the detector is type specific.
std::map< const MSVehicleType *, int > typedAmount
The number of vehicles that entered this lane within the sample interval by type. ...
The vehicle has departed (was inserted into the network)
const MSMeanData *const myParent
The meandata parent.
void addTo(MSMeanData::MeanDataValues &val) const
Add the values of this to the given one and store them there.
virtual ~MSLaneMeanDataValues()
Destructor.
virtual void writeXMLDetectorProlog(OutputDevice &dev) const
Opens the XML-output using "netstats" as root element.
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.
Static storage of an output device and its base (abstract) implementation.
bool closeTag()
Closes the most recently opened tag.
const bool myDumpEmpty
Whether empty lanes/edges shall be written.
bool isEmpty() const
Returns whether any data was collected.
Representation of a lane in the micro simulation.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
std::map< const MSVehicleType *, SUMOReal > typedTravelDistance
The sum of the distances the vehicles travelled by type.
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.