75 for (std::map<const MSVehicleType*, int>::const_iterator it =
typedAmount.begin(); it !=
typedAmount.end(); ++it) {
78 for (std::map<const MSVehicleType*, double>::const_iterator it =
typedSamples.begin(); it !=
typedSamples.end(); ++it) {
119 const double ,
const double defaultTravelTime,
const int )
const {
122 }
else if (defaultTravelTime >= 0.) {
128 for (std::map<const MSVehicleType*, int>::const_iterator it =
typedAmount.begin(); it !=
typedAmount.end(); ++it) {
142 const SUMOTime dumpEnd,
const bool useLanes,
143 const bool withEmpty,
const bool printDefaults,
144 const bool withInternal,
145 const bool trackVehicles,
146 const double maxTravelTime,
147 const double minSamples,
148 const double haltSpeed,
149 const std::string& vTypes)
150 :
MSMeanData(id, dumpBegin, dumpEnd, useLanes, withEmpty, printDefaults,
151 withInternal, trackVehicles, maxTravelTime, minSamples, vTypes),
173 const int duration = int(1000 *
STEPS2TIME(stopTime - startTime) + 0.5);
Data collector for edges/lanes.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
SumoXMLTag
Numbers representing SUMO-XML - element names.
Representation of a vehicle in the micro simulation.
Network state mean data collector for edges/lanes.
The vehicle arrived at a junction.
bool vehicleApplies(const SUMOVehicle &veh) const
Checks whether the detector measures vehicles of the given type.
Notification
Definition of a vehicle state.
void notifyMoveInternal(const SUMOVehicle &veh, const double, const double timeOnLane, const double, const double meanSpeedVehicleOnLane, const double travelledDistanceFrontOnLane, const double travelledDistanceVehicleOnLane, const double)
Internal notification about the vehicle moves.
void addTo(MSMeanData::MeanDataValues &val) const
Add the values of this to the given one and store them there.
std::map< const MSVehicleType *, double > typedSamples
The number of sampled vehicle movements by type (in s)
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 double maxTravelTime, const double minSamples, const double haltSpeed, const std::string &vTypes)
Constructor.
bool isEmpty() const
Returns whether any data was collected.
const MSLane * getLane() const
Returns the lane the reminder works on.
void write(OutputDevice &dev, const SUMOTime period, const double numLanes, const double defaultTravelTime, const int numVehicles=-1) const
Writes output values into the given stream.
Data structure for mean (aggregated) edge/lane values.
MSMeanData::MeanDataValues * createValues(MSLane *const lane, const double length, const bool doAdd) const
Create an instance of MeanDataValues.
A road/street connecting two junctions.
virtual ~MSMeanData_Amitran()
Destructor.
double travelledDistance
The sum of the distances the vehicles travelled.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Representation of a vehicle.
Data structure for mean (aggregated) edge/lane values.
bool writeXMLHeader(const std::string &rootElement, const std::string &schemaFile, std::map< SumoXMLAttr, std::string > attrs=std::map< SumoXMLAttr, std::string >())
Writes an XML header with optional configuration.
virtual bool isEmpty() const
Returns whether any data was collected.
bool isTyped() const
Checks whether the detector is type specific.
void reset(bool afterWrite=false)
Resets values so they may be used for the next interval.
const double myHaltSpeed
the minimum sample seconds
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 double myLaneLength
The length of the lane / edge the data collector is on.
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.
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.
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)
std::map< const MSVehicleType *, double > typedTravelDistance
The sum of the distances the vehicles travelled by type.
virtual void writeXMLDetectorProlog(OutputDevice &dev) const
Opens the XML-output using "netstats" as root element.
const MSMeanData *const myParent
The meandata parent.
int getNumericalID() const
Returns the numerical id of the edge.
virtual ~MSLaneMeanDataValues()
Destructor.
MSLaneMeanDataValues(MSLane *const lane, const double length, const bool doAdd, const MSMeanData_Amitran *parent)
Constructor.
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 notifyEnter(SUMOVehicle &veh, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Computes current values and adds them to their sums.
Representation of a lane in the micro simulation.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.