42 #ifdef CHECK_MEMORY_LEAKS
44 #endif // CHECK_MEMORY_LEAKS
54 const SUMOReal length,
const bool doAdd,
67 travelledDistance = 0.;
83 sampleSeconds += timeOnLane;
84 travelledDistance += travelledDistanceVehicleOnLane;
88 meanSpeedVehicleOnLane, a, veh.
getSlope()), timeOnLane);
110 if (sampleSeconds > myParent->getMinSamples()) {
111 SUMOReal vehFactor = myParent->getMaxTravelTime() / sampleSeconds;
112 SUMOReal traveltime = myParent->getMaxTravelTime();
113 if (travelledDistance > 0.f) {
114 vehFactor =
MIN2(vehFactor, myLaneLength / travelledDistance);
115 traveltime =
MIN2(traveltime, myLaneLength * sampleSeconds / travelledDistance);
125 }
else if (defaultTravelTime >= 0.) {
149 const bool useLanes,
const bool withEmpty,
150 const bool printDefaults,
151 const bool withInternal,
152 const bool trackVehicles,
155 const std::string& vTypes)
156 :
MSMeanData(id, dumpBegin, dumpEnd, useLanes, withEmpty, printDefaults,
157 withInternal, trackVehicles, maxTravelTime, minSamples, vTypes) {
Data collector for edges/lanes.
SUMOReal getMaxSpeed() const
Get vehicle's maximum speed [m/s].
void addScaled(const Emissions &a, const SUMOReal scale=1.)
Add the values of the other struct to this one, scaling the values if needed.
static Emissions computeAll(const SUMOEmissionClass c, const double v, const double a, const double slope)
Returns the amount of all emitted pollutants given the vehicle type and state (in mg/s or ml/s for fu...
SUMOReal travelledDistance
The sum of the distances the vehicles travelled.
void reset(bool afterWrite=false)
Resets values so they may be used for the next interval.
Storage for collected values of all emission types.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
PollutantsInterface::Emissions myEmissions
Collected values.
MSLaneMeanDataValues(MSLane *const lane, const SUMOReal length, const bool doAdd, const MSMeanData_Emissions *parent)
Constructor.
The car-following model and parameter.
const MSCFModel & getCarFollowModel() const
Returns the vehicle type's car following model definition (const version)
Representation of a vehicle.
Data structure for mean (aggregated) edge/lane values.
static SUMOReal computeDefault(const SUMOEmissionClass c, const EmissionType e, const double v, const double a, const double slope, const SUMOReal tt)
Returns the amount of emitted pollutant given the vehicle type and default values for the state (in m...
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
Emission data collector for edges/lanes.
SUMOReal getMaxAccel() const
Get the vehicle type's maximum acceleration [m/s^2].
MSMeanData_Emissions(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 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.
void addTo(MSMeanData::MeanDataValues &val) const
Add the values of this to the given one and store them there.
virtual ~MSMeanData_Emissions()
Destructor.
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.
Static storage of an output device and its base (abstract) implementation.
bool closeTag()
Closes the most recently opened tag.
virtual SUMOReal getSlope() const =0
Returns the slope of the road at vehicle's position.
virtual ~MSLaneMeanDataValues()
Destructor.
SUMOEmissionClass getEmissionClass() const
Get this vehicle type's emission class.
MSVehicleType * getVType(const std::string &id=DEFAULT_VTYPE_ID, MTRand *rng=0)
Returns the named vehicle type or a sample from the named distribution.
MSMeanData::MeanDataValues * createValues(MSLane *const lane, const SUMOReal length, const bool doAdd) const
Create an instance of MeanDataValues.
Representation of a lane 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.
Data structure for mean (aggregated) edge/lane values.
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.