42 #ifdef CHECK_MEMORY_LEAKS
44 #endif // CHECK_MEMORY_LEAKS
54 const SUMOReal length,
const bool doAdd,
55 const std::set<std::string>*
const vTypes,
58 CO2(0), CO(0), HC(0), NOx(0), PMx(0), fuel(0), myParent(parent) {}
68 travelledDistance = 0.;
94 sampleSeconds += timeOnLane;
95 travelledDistance += speed * timeOnLane;
120 if (sampleSeconds > myParent->myMinSamples) {
122 SUMOReal vehFactor = myParent->myMaxTravelTime / sampleSeconds;
123 SUMOReal traveltime = myParent->myMaxTravelTime;
124 if (travelledDistance > 0.f) {
125 vehFactor =
MIN2(vehFactor, myLaneLength / travelledDistance);
126 traveltime =
MIN2(traveltime, myLaneLength * sampleSeconds / travelledDistance);
135 }
else if (defaultTravelTime >= 0.) {
158 const bool useLanes,
const bool withEmpty,
159 const bool printDefaults,
160 const bool withInternal,
161 const bool trackVehicles,
164 const std::set<std::string> vTypes)
165 :
MSMeanData(id, dumpBegin, dumpEnd, useLanes, withEmpty, printDefaults,
166 withInternal, trackVehicles, maxTravelTime, minSamples, vTypes) {
static SUMOReal computeCO(SUMOEmissionClass c, double v, double a)
Returns the amount of emitted CO given the vehicle type and state (in mg/s)
Data collector for edges/lanes.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
SUMOReal getMaxSpeed() const
Get vehicle's maximum speed [m/s].
virtual ~MSMeanData_HBEFA()
Destructor.
static SUMOReal computeHC(SUMOEmissionClass c, double v, double a)
Returns the amount of emitted HC given the vehicle type and state (in mg/s)
void reset(bool afterWrite=false)
Resets values so they may be used for the next interval.
static SUMOReal computeDefaultFuel(SUMOEmissionClass c, double v, double a, SUMOReal tt)
Returns the amount of fuel given the vehicle type and default values for the state (in ml) ...
virtual ~MSLaneMeanDataValues()
Destructor.
SUMOReal travelledDistance
The sum of the distances the vehicles travelled.
MSVehicleType * getVType(const std::string &id=DEFAULT_VTYPE_ID)
Returns the named vehicle type or a sample from the named distribution.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
const std::set< std::string > myVehicleTypes
The vehicle types to look for (empty means all)
The car-following model and parameter.
const MSCFModel & getCarFollowModel() const
Returns the vehicle type's car following model definition (const version)
void addTo(MSMeanData::MeanDataValues &val) const
Add the values of this to the given one and store them there.
static SUMOReal computeDefaultNOx(SUMOEmissionClass c, double v, double a, SUMOReal tt)
Returns the amount of emitted NOx given the vehicle type and default values for the state (in mg) ...
Representation of a vehicle.
Data structure for mean (aggregated) edge/lane values.
static SUMOReal computeCO2(SUMOEmissionClass c, double v, double a)
Returns the amount of emitted CO2 given the vehicle type and state (in mg/s)
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
SUMOReal HC
Sum of HC emissions in mg.
void notifyMoveInternal(SUMOVehicle &veh, SUMOReal timeOnLane, SUMOReal speed)
Internal notification about the vehicle moves.
SUMOReal fuel
Sum of consumed fuel in ml.
static SUMOReal computeDefaultCO2(SUMOEmissionClass c, double v, double a, SUMOReal tt)
Returns the amount of emitted CO2 given the vehicle type and default values for the state (in mg) ...
SUMOReal getMaxAccel() const
Get the vehicle type's maximum acceleration [m/s^2].
SUMOReal PMx
Sum of PMx emissions in mg.
static SUMOReal computeDefaultPMx(SUMOEmissionClass c, double v, double a, SUMOReal tt)
Returns the amount of emitted PMx given the vehicle type and default values for the state (in mg) ...
MSMeanData_HBEFA(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::set< std::string > vTypes)
Constructor.
Data structure for mean (aggregated) edge/lane values.
virtual SUMOReal getAcceleration() const =0
Returns the vehicle's acceleration.
static std::string realString(const SUMOReal v, const int precision=OUTPUT_ACCURACY)
Helper method for string formatting.
static SUMOReal computeNOx(SUMOEmissionClass c, double v, double a)
Returns the amount of emitted NOx given the vehicle type and state (in mg/s)
static SUMOReal computeDefaultCO(SUMOEmissionClass c, double v, double a, SUMOReal tt)
Returns the amount of emitted CO given the vehicle type and default values for the state (in mg) ...
MSMeanData::MeanDataValues * createValues(MSLane *const lane, const SUMOReal length, const bool doAdd) const
Create an instance of MeanDataValues.
static SUMOReal computeFuel(SUMOEmissionClass c, double v, double a)
Returns the amount of consumed fuel given the vehicle type and state (in ml/s)
static SUMOReal computePMx(SUMOEmissionClass c, double v, double a)
Returns the amount of emitted PMx given the vehicle type and state (in mg/s)
Static storage of an output device and its base (abstract) implementation.
bool closeTag()
Closes the most recently opened tag.
static SUMOReal computeDefaultHC(SUMOEmissionClass c, double v, double a, SUMOReal tt)
Returns the amount of emitted HC given the vehicle type and default values for the state (in mg) ...
MSLaneMeanDataValues(MSLane *const lane, const SUMOReal length, const bool doAdd, const std::set< std::string > *const vTypes=0, const MSMeanData_HBEFA *parent=0)
Constructor.
SUMOEmissionClass getEmissionClass() const
Get this vehicle type's emission class.
SUMOReal CO
Sum of CO emissions in mg.
Representation of a lane in the micro simulation.
Emission data collector for edges/lanes.
SUMOReal NOx
Sum of NOx emissions in mg.
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.
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.