 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
45 currentTimeN(0), meanNTemp(0), myParent(parent) {}
57 travelledDistance = 0;
72 meanNTemp += currentTimeN;
82 currentTimeN += (double) pow(10., (
sn / 10.));
83 sampleSeconds += timeOnLane;
84 travelledDistance += travelledDistanceVehicleOnLane;
90 const double ,
const double defaultTravelTime,
const int )
const {
91 dev.
writeAttr(
"noise", (meanNTemp != 0 ? (
double)(10. * log10(meanNTemp *
TS /
STEPS2TIME(period))) : (
double) 0.));
92 if (sampleSeconds > myParent->myMinSamples) {
93 double traveltime = myParent->myMaxTravelTime;
94 if (travelledDistance > 0.f) {
95 traveltime =
MIN2(traveltime, myLaneLength * sampleSeconds / travelledDistance);
98 }
else if (defaultTravelTime >= 0.) {
100 dev.
writeAttr(
"traveltime", defaultTravelTime);
112 const bool useLanes,
const bool withEmpty,
113 const bool printDefaults,
const bool withInternal,
114 const bool trackVehicles,
115 const double maxTravelTime,
const double minSamples,
116 const std::string& vTypes)
117 :
MSMeanData(id, dumpBegin, dumpEnd, useLanes, withEmpty, printDefaults,
118 withInternal, trackVehicles, 0, maxTravelTime, minSamples, vTypes) {
134 for (std::vector<std::vector<MeanDataValues*> >::const_iterator i =
myMeasures.begin(); i !=
myMeasures.end(); ++i) {
135 const std::vector<MeanDataValues*>& lm = *i;
136 for (std::vector<MeanDataValues*>::const_iterator j = lm.begin(); j != lm.end(); ++j) {
SUMOEmissionClass getEmissionClass() const
Get this vehicle type's emission class.
Representation of a vehicle or person.
void addTo(MSMeanData::MeanDataValues &val) const
Add the values to this meanData.
double meanNTemp
Sum of produced noise over time (pow(10, (<NOISE>/10.)))
Representation of a lane in the micro simulation.
MSMeanData::MeanDataValues * createValues(MSLane *const lane, const double length, const bool doAdd) const
Create an instance of MeanDataValues.
virtual double getAcceleration() const =0
Returns the vehicle's acceleration.
Static storage of an output device and its base (abstract) implementation.
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.
Noise data collector for edges/lanes.
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 double minSamples, const double maxTravelTime, const std::string &vTypes)
Constructor.
void update()
Computes the noise in the last time step.
std::vector< std::vector< MeanDataValues * > > myMeasures
Value collectors; sorted by edge, then by lane.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Data collector for edges/lanes.
static double computeNoise(SUMOEmissionClass c, double v, double a)
Returns the noise produced by the a vehicle of the given type at the given speed.
MSLaneMeanDataValues(MSLane *const lane, const double length, const bool doAdd, const MSMeanData_Harmonoise *parent)
Constructor.
double travelledDistance
The sum of the distances the vehicles travelled.
virtual void detectorUpdate(const SUMOTime step)
Updates the detector.
Data structure for mean (aggregated) edge/lane values.
Data structure for mean (aggregated) edge/lane values.
virtual ~MSMeanData_Harmonoise()
Destructor.
void reset(bool afterWrite=false)
Resets values so they may be used for the next interval.
virtual ~MSLaneMeanDataValues()
Destructor.
void notifyMoveInternal(const SUMOTrafficObject &veh, const double, const double timeOnLane, const double meanSpeedFrontOnLane, const double meanSpeedVehicleOnLane, const double travelledDistanceFrontOnLane, const double travelledDistanceVehicleOnLane, const double)
Internal notification about the vehicle moves.
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.
virtual void detectorUpdate(const SUMOTime step)
Updates the detector.