53 #define DEBUG_COND (false) 67 nVehDeparted(0), nVehArrived(0), nVehEntered(0), nVehLeft(0),
68 nVehVaporized(0), waitSeconds(0),
69 nVehLaneChangeFrom(0), nVehLaneChangeTo(0),
70 frontSampleSeconds(0), frontTravelledDistance(0),
71 vehLengthSum(0), occupationSum(0),
128 const double timeOnLane,
const double ,
129 const double meanSpeedVehicleOnLane,
130 const double travelledDistanceFrontOnLane,
131 const double travelledDistanceVehicleOnLane,
132 const double meanLengthOnLane) {
133 #ifdef DEBUG_OCCUPANCY 135 std::cout <<
SIMTIME <<
"\n MSMeanData_Net::MSLaneMeanDataValues::notifyMoveInternal()\n" 137 <<
", timeOnLane=" << timeOnLane
138 <<
", meanSpeedVehicleOnLane=" << meanSpeedVehicleOnLane
139 <<
",\ntravelledDistanceFrontOnLane=" << travelledDistanceFrontOnLane
140 <<
", travelledDistanceVehicleOnLane=" << travelledDistanceVehicleOnLane
141 <<
", meanLengthOnLane=" << meanLengthOnLane
168 #ifdef DEBUG_OCCUPANCY2 201 #ifdef DEBUG_NOTIFY_ENTER 202 std::cout <<
"\n" <<
SIMTIME <<
" MSMeanData_Net::MSLaneMeanDataValues: veh '" << veh.
getID() <<
"' enters lane '" << enteredLane->
getID() <<
"'" << std::endl;
231 const double numLanes,
const double defaultTravelTime,
const int numVehicles)
const {
233 #ifdef DEBUG_OCCUPANCY2 236 if (occupancy > 100) {
237 std::cout <<
SIMTIME <<
" Encountered bad occupancy: " << occupancy
266 if (numVehicles > 0) {
273 }
else if (defaultTravelTime >= 0.) {
274 dev.
writeAttr(
"traveltime", defaultTravelTime);
276 dev.
writeAttr(
"overlapTraveltime", overlapTraveltime)
281 }
else if (defaultTravelTime >= 0.) {
297 const SUMOTime dumpEnd,
const bool useLanes,
298 const bool withEmpty,
const bool printDefaults,
299 const bool withInternal,
300 const bool trackVehicles,
301 const double maxTravelTime,
302 const double minSamples,
303 const double haltSpeed,
304 const std::string& vTypes)
305 :
MSMeanData(id, dumpBegin, dumpEnd, useLanes, withEmpty, printDefaults,
306 withInternal, trackVehicles, maxTravelTime, minSamples, vTypes),
virtual MSLane * getLane() const =0
Returns the lane the vehicle is on.
Data collector for edges/lanes.
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.
Representation of a vehicle in the micro simulation.
const std::string & getDescription() const
bool notifyLeave(SUMOVehicle &veh, double lastPos, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Called if the vehicle leaves the reminder's lane.
int nVehVaporized
The number of vehicles that left this lane within the sample interval.
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.
bool vehicleApplies(const SUMOVehicle &veh) const
Checks whether the detector measures vehicles of the given type.
void removeFromVehicleUpdateValues(SUMOVehicle &veh)
void addTo(MSMeanData::MeanDataValues &val) const
Add the values of this to the given one and store them there.
MSMeanData::MeanDataValues * createValues(MSLane *const lane, const double length, const bool doAdd) const
Create an instance of MeanDataValues.
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)
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.
const MSLane * getLane() const
Returns the lane the reminder works on.
const std::string & getID() const
Returns the id.
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.
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.
Data structure for mean (aggregated) edge/lane values.
virtual ~MSMeanData_Net()
Destructor.
The vehicle arrived at its destination (is deleted)
bool isEmpty() const
Returns whether any data was collected.
void notifyMoveInternal(const SUMOVehicle &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.
const double myLaneLength
The length of the lane / edge the data collector is on.
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.
bool notifyEnter(SUMOVehicle &veh, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Computes current values and adds them to their sums.
const double myMinSamples
the minimum sample seconds
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 double maxTravelTime, const double minSamples, const double haltSpeed, const std::string &vTypes)
Constructor.
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.
double getLength() const
Get vehicle's length [m].
The vehicle has departed (was inserted into the network)
double frontTravelledDistance
The travelled distance regarding the vehicle front.
int nVehLaneChangeFrom
The number of vehicles that changed from this lane.
virtual const std::string & getID() const =0
Get the vehicle's ID.
double occupationSum
The sum of the occupation of the lane.
Static storage of an output device and its base (abstract) implementation.
Network state mean data collector for edges/lanes.
bool closeTag()
Closes the most recently opened tag.
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.