42 #ifdef CHECK_MEMORY_LEAKS
44 #endif // CHECK_MEMORY_LEAKS
56 currentTimeN(0), meanNTemp(0), myParent(parent) {}
68 travelledDistance = 0;
93 currentTimeN += (
SUMOReal) pow(10., (sn / 10.));
94 sampleSeconds += timeOnLane;
95 travelledDistance += travelledDistanceVehicleOnLane;
103 if (sampleSeconds > myParent->myMinSamples) {
104 SUMOReal traveltime = myParent->myMaxTravelTime;
105 if (travelledDistance > 0.f) {
106 traveltime =
MIN2(traveltime, myLaneLength * sampleSeconds / travelledDistance);
109 }
else if (defaultTravelTime >= 0.) {
111 dev.
writeAttr(
"traveltime", defaultTravelTime);
123 const bool useLanes,
const bool withEmpty,
124 const bool printDefaults,
const bool withInternal,
125 const bool trackVehicles,
127 const std::string& vTypes)
128 :
MSMeanData(id, dumpBegin, dumpEnd, useLanes, withEmpty, printDefaults,
129 withInternal, trackVehicles, maxTravelTime, minSamples, vTypes) {
145 for (std::vector<std::vector<MeanDataValues*> >::const_iterator i =
myMeasures.begin(); i !=
myMeasures.end(); ++i) {
146 const std::vector<MeanDataValues*>& lm = *i;
147 for (std::vector<MeanDataValues*>::const_iterator j = lm.begin(); j != lm.end(); ++j) {
Data collector for edges/lanes.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
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.
std::vector< std::vector< MeanDataValues * > > myMeasures
Value collectors; sorted by edge, then by lane.
void reset(bool afterWrite=false)
Resets values so they may be used for the next interval.
SUMOReal travelledDistance
The sum of the distances the vehicles travelled.
SUMOReal meanNTemp
Sum of produced noise over time (pow(10, (/10.)))
virtual ~MSMeanData_Harmonoise()
Destructor.
Noise data collector for edges/lanes.
void update()
Computes the noise in the last time step.
static SUMOReal computeNoise(SUMOEmissionClass c, double v, double a)
Returns the noise produced by the a vehicle of the given type at the given speed. ...
Representation of a vehicle.
Data structure for mean (aggregated) edge/lane values.
Data structure for mean (aggregated) edge/lane values.
void notifyMoveInternal(const SUMOVehicle &veh, const SUMOReal, const SUMOReal timeOnLane, const SUMOReal meanSpeedFrontOnLane, const SUMOReal meanSpeedVehicleOnLane, const SUMOReal travelledDistanceFrontOnLane, const SUMOReal travelledDistanceVehicleOnLane)
Internal notification about the vehicle moves.
virtual void detectorUpdate(const SUMOTime step)
Updates the detector.
void addTo(MSMeanData::MeanDataValues &val) const
Add the values to this meanData.
virtual ~MSLaneMeanDataValues()
Destructor.
MSMeanData::MeanDataValues * createValues(MSLane *const lane, const SUMOReal length, const bool doAdd) const
Create an instance of MeanDataValues.
virtual SUMOReal getAcceleration() const =0
Returns the vehicle's acceleration.
static SUMOReal sum(SUMOReal val)
Computes the resulting noise.
virtual void detectorUpdate(const SUMOTime step)
Updates the detector.
Static storage of an output device and its base (abstract) implementation.
bool closeTag()
Closes the most recently opened tag.
MSLaneMeanDataValues(MSLane *const lane, const SUMOReal length, const bool doAdd, const MSMeanData_Harmonoise *parent)
Constructor.
SUMOEmissionClass getEmissionClass() const
Get this vehicle type's emission class.
Representation of a lane in the micro simulation.
MSMeanData_Harmonoise(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::string &vTypes)
Constructor.
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.