46 #define DEBUG_COND (false) 60 nVehDeparted(0), nVehArrived(0), nVehEntered(0), nVehLeft(0),
61 nVehVaporized(0), waitSeconds(0),
62 nVehLaneChangeFrom(0), nVehLaneChangeTo(0),
63 frontSampleSeconds(0), frontTravelledDistance(0),
64 vehLengthSum(0), occupationSum(0),
121 const double timeOnLane,
const double ,
122 const double meanSpeedVehicleOnLane,
123 const double travelledDistanceFrontOnLane,
124 const double travelledDistanceVehicleOnLane,
125 const double meanLengthOnLane) {
126 #ifdef DEBUG_OCCUPANCY 128 std::cout <<
SIMTIME <<
"\n MSMeanData_Net::MSLaneMeanDataValues::notifyMoveInternal()\n" 129 <<
" veh '" << veh.
getID() <<
"' on lane '" << veh.getLane()->
getID() <<
"'" 130 <<
", timeOnLane=" << timeOnLane
131 <<
", meanSpeedVehicleOnLane=" << meanSpeedVehicleOnLane
132 <<
",\ntravelledDistanceFrontOnLane=" << travelledDistanceFrontOnLane
133 <<
", travelledDistanceVehicleOnLane=" << travelledDistanceVehicleOnLane
134 <<
", meanLengthOnLane=" << meanLengthOnLane
164 #ifdef DEBUG_OCCUPANCY2 198 #ifdef DEBUG_NOTIFY_ENTER 199 std::cout <<
"\n" <<
SIMTIME <<
" MSMeanData_Net::MSLaneMeanDataValues: veh '" << veh.
getID() <<
"' enters lane '" << enteredLane->
getID() <<
"'" << std::endl;
228 const double numLanes,
const double defaultTravelTime,
const int numVehicles)
const {
230 #ifdef DEBUG_OCCUPANCY2 233 if (occupancy > 100) {
234 std::cout <<
SIMTIME <<
" Encountered bad occupancy: " << occupancy
263 if (numVehicles > 0) {
270 }
else if (defaultTravelTime >= 0.) {
271 dev.
writeAttr(
"traveltime", defaultTravelTime);
273 dev.
writeAttr(
"overlapTraveltime", overlapTraveltime)
278 }
else if (defaultTravelTime >= 0.) {
294 const SUMOTime dumpEnd,
const bool useLanes,
295 const bool withEmpty,
const bool printDefaults,
296 const bool withInternal,
297 const bool trackVehicles,
299 const double maxTravelTime,
300 const double minSamples,
301 const double haltSpeed,
302 const std::string& vTypes)
303 :
MSMeanData(id, dumpBegin, dumpEnd, useLanes, withEmpty, printDefaults,
304 withInternal, trackVehicles, detectPersons, maxTravelTime, minSamples, vTypes),
void notifyMoveInternal(const SUMOTrafficObject &veh, const double frontOnLane, const double timeOnLane, const double, const double meanSpeedVehicleOnLane, const double travelledDistanceFrontOnLane, const double travelledDistanceVehicleOnLane, const double meanLengthOnLane)
Internal notification about the vehicle moves.
Data collector for edges/lanes.
const MSLane * getLane() const
Returns the lane the reminder works on.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
double vehLengthSum
The sum of the lengths the vehicles had.
int nVehEntered
The number of vehicles that entered this lane within the sample interval.
virtual ~MSLaneMeanDataValues()
Destructor.
bool vehicleApplies(const SUMOTrafficObject &veh) const
Checks whether the detector measures vehicles of the given type.
Representation of a vehicle in the micro simulation.
bool detectPersons() const
MSMeanData_Net(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 int detectPersons, const double maxTravelTime, const double minSamples, const double haltSpeed, const std::string &vTypes)
Constructor.
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.
int nVehVaporized
The number of vehicles that left this lane within the sample interval.
virtual const std::string & getID() const =0
Get the vehicle's ID.
double frontSampleSeconds
The number of vehicle probes regarding the vehicle front.
const double myMaxTravelTime
the maximum travel time to write
The vehicle arrived at a junction.
virtual bool isVehicle() const =0
Get the vehicle's ID.
Notification
Definition of a vehicle state.
const MSMeanData_Net * myParent
The meandata parent.
const double myHaltSpeed
the minimum sample seconds
The vehicle got vaporized.
The vehicle changes the segment (meso only)
MSMeanData::MeanDataValues * createValues(MSLane *const lane, const double length, const bool doAdd) const
Create an instance of MeanDataValues.
bool notifyLeave(SUMOTrafficObject &veh, double lastPos, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Called if the vehicle leaves the reminder's lane.
const std::string & getID() const
Returns the id.
MSLaneMeanDataValues(MSLane *const lane, const double length, const bool doAdd, const MSMeanData_Net *parent)
Constructor.
#define UNUSED_PARAMETER(x)
Data structure for mean (aggregated) edge/lane values.
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.
The vehicle changes lanes (micro only)
int nVehLaneChangeTo
The number of vehicles that changed to this lane.
double travelledDistance
The sum of the distances the vehicles travelled.
Data structure for mean (aggregated) edge/lane values.
virtual ~MSMeanData_Net()
Destructor.
The vehicle arrived at its destination (is deleted)
bool notifyEnter(SUMOTrafficObject &veh, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Computes current values and adds them to their sums.
const double myLaneLength
The length of the lane / edge the data collector is on.
const double myMinSamples
the minimum sample seconds
double waitSeconds
The number of vehicle probes with small speed.
int nVehLeft
The number of vehicles that left this lane within the sample interval.
int nVehArrived
The number of vehicles that finished on the lane.
The vehicle has departed (was inserted into the network)
Representation of a vehicle or person.
double frontTravelledDistance
The travelled distance regarding the vehicle front.
const std::string & getDescription() const
int nVehLaneChangeFrom
The number of vehicles that changed from this lane.
void removeFromVehicleUpdateValues(SUMOTrafficObject &veh)
double occupationSum
The sum of the occupation of the lane.
double getLength() const
Get vehicle's length [m].
void addTo(MSMeanData::MeanDataValues &val) const
Add the values of this to the given one and store them there.
bool isEmpty() const
Returns whether any data was collected.
Static storage of an output device and its base (abstract) implementation.
Network state mean data collector for edges/lanes.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
void reset(bool afterWrite=false)
Resets values so they may be used for the next interval.
const double INVALID_DOUBLE
double minimalVehicleLength
minimal vehicle length in the current interval (used to determine a maximal density, see #3265)
Representation of a lane in the micro simulation.