 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
43 const double length,
const bool doAdd,
56 travelledDistance = 0.;
73 sampleSeconds += timeOnLane;
74 travelledDistance += travelledDistanceVehicleOnLane;
78 meanSpeedVehicleOnLane, a, veh.
getSlope(),
86 const double ,
const double defaultTravelTime,
const int )
const {
87 const double normFactor = double(3600. /
STEPS2TIME(period) / myLaneLength);
102 if (sampleSeconds > myParent->getMinSamples()) {
103 double vehFactor = myParent->getMaxTravelTime() / sampleSeconds;
104 double traveltime = myParent->getMaxTravelTime();
105 if (travelledDistance > 0.f) {
106 vehFactor =
MIN2(vehFactor, myLaneLength / travelledDistance);
107 traveltime =
MIN2(traveltime, myLaneLength * sampleSeconds / travelledDistance);
117 }
else if (defaultTravelTime >= 0.) {
119 const double speed =
MIN2(myLaneLength / defaultTravelTime, t->
getMaxSpeed());
141 const bool useLanes,
const bool withEmpty,
142 const bool printDefaults,
143 const bool withInternal,
144 const bool trackVehicles,
145 const double maxTravelTime,
146 const double minSamples,
147 const std::string& vTypes)
148 :
MSMeanData(id, dumpBegin, dumpEnd, useLanes, withEmpty, printDefaults,
149 withInternal, trackVehicles, 0, maxTravelTime, minSamples, vTypes) {
The car-following model and parameter.
SUMOEmissionClass getEmissionClass() const
Get this vehicle type's emission class.
Representation of a vehicle or person.
double getMaxAccel() const
Get the vehicle type's maximum acceleration [m/s^2].
Representation of a lane in the micro simulation.
MSVehicleType * getVType(const std::string &id=DEFAULT_VTYPE_ID, std::mt19937 *rng=nullptr)
Returns the named vehicle type or a sample from the named distribution.
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.
virtual bool isVehicle() const =0
Get the vehicle's ID.
Representation of a vehicle.
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 const std::map< int, double > * getEmissionParameters() const =0
Returns the vehicle's emission model parameter.
virtual ~MSLaneMeanDataValues()
Destructor.
PollutantsInterface::Emissions myEmissions
Collected values.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
Data collector for edges/lanes.
Emission data collector for edges/lanes.
const MSCFModel & getCarFollowModel() const
Returns the vehicle type's car following model definition (const version)
double travelledDistance
The sum of the distances the vehicles travelled.
virtual double getSlope() const =0
Returns the slope of the road at vehicle's position.
static Emissions computeAll(const SUMOEmissionClass c, const double v, const double a, const double slope, const std::map< int, double > *param=0)
Returns the amount of all emitted pollutants given the vehicle type and state (in mg/s or ml/s for fu...
void addScaled(const Emissions &a, const double scale=1.)
Add the values of the other struct to this one, scaling the values if needed.
void notifyMoveInternal(const SUMOTrafficObject &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.
static double computeDefault(const SUMOEmissionClass c, const EmissionType e, const double v, const double a, const double slope, const double tt, const std::map< int, double > *param=0)
Returns the amount of emitted pollutant given the vehicle type and default values for the state (in m...
Data structure for mean (aggregated) edge/lane values.
virtual ~MSMeanData_Emissions()
Destructor.
MSLaneMeanDataValues(MSLane *const lane, const double length, const bool doAdd, const MSMeanData_Emissions *parent)
Constructor.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
void addTo(MSMeanData::MeanDataValues &val) const
Add the values of this to the given one and store them there.
Storage for collected values of all emission types.
double getMaxSpeed() const
Get vehicle's maximum speed [m/s].
static std::string realString(const double v, const int precision=gPrecision)
Helper method for string formatting.
MSMeanData::MeanDataValues * createValues(MSLane *const lane, const double length, const bool doAdd) const
Create an instance of MeanDataValues.
Data structure for mean (aggregated) edge/lane values.
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 double minSamples, const double maxTravelTime, const std::string &vTypes)
Constructor.
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
void reset(bool afterWrite=false)
Resets values so they may be used for the next interval.