79 double positionInMeters,
80 double length, std::string name,
81 const std::string& vTypes,
82 const std::string& nextEdges,
84 const bool needLocking);
92 virtual void reset()
override;
178 double getSpeed(
const int offset)
const;
219 std::vector<std::string>
getVehicleIDs(
const int offset)
const;
311 double leaveTimestep,
const bool leftEarly,
const double detLength = 0);
337 std::vector<VehicleData>
collectVehiclesOnDet(
SUMOTime t,
bool includeEarly =
false,
bool leaveTime =
false,
bool forOccupancy =
false,
bool lastInterval =
false)
const;
353 return sumSoFar + data.
speedM;
358 return sumSoFar + data.
lengthM;
366 typedef std::priority_queue<SUMOTime, std::vector<SUMOTime>, std::greater<SUMOTime>>
TimeQueue;
A single mesoscopic segment (cell)
Base of value-generating classes (detectors)
An unextended detector measuring at a fixed position on a fixed lane.
void writeXMLDetectorProlog(OutputDevice &dev) const override
Opens the XML-output using "detector" as root element.
double getOccupancyTime() const
Returns the time of continous occupation by the same vehicle in seconds or 0 if there is no vehicle o...
static double lengthSum(double sumSoFar, const MSInductLoop::VehicleData &data)
Adds up VehicleData::lengthM.
double getOccupancy() const
Returns the current occupancy.
double getIntervalOccupancy(bool lastInterval=false) const
std::vector< std::string > getIntervalVehicleIDs(bool lastInterval=false) const
int myEnteredVehicleNumber
The number of entered vehicles.
std::priority_queue< SUMOTime, std::vector< SUMOTime >, std::greater< SUMOTime > > TimeQueue
helper function for managing meso timings
std::deque< VehicleData > VehicleDataCont
Type of myVehicleDataCont.
double getEnteredNumber(const int offset) const
Returns the number of vehicles that have passed the detector.
int getIntervalVehicleNumber(bool lastInterval=false) const
static double speedSum(double sumSoFar, const MSInductLoop::VehicleData &data)
Adds up VehicleData::speedM.
MESegment * mySegment
current segment (for actuated tls in meso)
std::vector< VehicleData > collectVehiclesOnDet(SUMOTime t, bool includeEarly=false, bool leaveTime=false, bool forOccupancy=false, bool lastInterval=false) const
Returns vehicle data for vehicles that have been on the detector starting at the given time.
VehicleDataCont myVehicleDataCont
Data of vehicles that have completely passed the detector.
double getEndPosition() const
Returns the end position of the detector on the lane.
double getPosition() const
Returns the position of the detector on the lane.
void overrideTimeSinceDetection(double time)
double myOverrideEntryTime
records the time at which overrideTimeSinceDetection was activated
double getSpeed(const int offset) const
Returns the speed of the vehicle on the detector.
SUMOTime myLastIntervalEnd
void loadState(const SUMOSAXAttributes &attrs, const SUMOTime offset) override
Loads the detection state, shifting all times by the given offset.
bool notifyLeave(SUMOTrafficObject &veh, double lastPos, MSMoveReminder::Notification reason, const MSLane *enteredLane=0) override
Dismisses the vehicle if it is on the detector due to a lane change.
static std::vector< SUMOTime > getTimes(TimeQueue tq, SUMOTime now)
virtual void setSpecialColor(const RGBColor *)
allows for special color in the gui version
bool notifyEnter(SUMOTrafficObject &veh, Notification reason, const MSLane *enteredLane=0) override
Checks whether the reminder is activated by a vehicle entering the lane.
static void discardOldTimes(TimeQueue &tq, SUMOTime now)
TimeQueue myLastMesoLeaveTimes
void detectorUpdate(const SUMOTime step) override
Updates the detector (computes values) only used when detecting persons.
std::vector< std::string > getVehicleIDs(const int offset) const
Returns the ids of vehicles that have passed the detector.
double getVehicleLength(const int offset) const
Returns the length of the vehicle on the detector.
SUMOTime myLastIntervalBegin
void writeXMLOutput(OutputDevice &dev, SUMOTime startTime, SUMOTime stopTime) override
Writes collected values into the given stream.
const double myPosition
Detector's position on lane [m].
std::string getName() const
get name
double getOverrideTime() const
VehicleDataCont myLastVehicleDataCont
Data of vehicles that have completely passed the detector in the last time interval.
const double myEndPosition
Detector's end position (defaults to myPosition)
~MSInductLoop()
Destructor.
MSInductLoop(const MSInductLoop &)
Invalidated copy constructor.
bool notifyMove(SUMOTrafficObject &veh, double oldPos, double newPos, double newSpeed) override
Checks whether the vehicle shall be counted and/or shall still touch this MSMoveReminder.
std::string myName
detecto name
void saveState(OutputDevice &out) const override
Saves the time of the last detection and the pending meso detections.
void notifyMovePerson(MSTransportable *p, int dir, double pos)
helper function for mapping person movement
double myOverrideTime
overrides the time since last detection
double getArrivalDelay() const
Returns the maximum stop arrival delay of public transport vehicles that are on the detector or passe...
double getTimeSinceLastDetection() const
Returns the time since the last vehicle left the detector.
double myLastLeaveTime
Leave-time of the last vehicle detected [s].
virtual void setVisible(bool)
TimeQueue myNextMesoLeaveTimes
extrapolated leave times for meso vehicle
MSInductLoop & operator=(const MSInductLoop &)
Invalidated assignment operator.
const bool myNeedLock
whether internals need to be guarded against concurrent access (GUI or multi threading)
virtual void reset() override
Resets all generated values to allow computation of next interval.
double mySegmentPos
position relative to the current segment
double getIntervalMeanSpeed(bool lastInterval=false) const
virtual void clearState(SUMOTime time) override
Remove all vehicles before quick-loading state.
std::map< SUMOTrafficObject *, double > myVehiclesOnDet
Data for vehicles that have entered the detector (vehicle -> enter time)
SUMOTime getLastDetectionTime() const
return last time a vehicle was on the detector
Representation of a lane in the micro simulation.
Something on a lane to be noticed about vehicle movement.
Notification
Definition of a vehicle state.
Representation of a vehicle in the micro simulation.
Static storage of an output device and its base (abstract) implementation.
Encapsulated SAX-Attributes.
Representation of a vehicle, person, or container.
Struct to store the data of the counted vehicle internally.
double lengthM
Length of the vehicle.
double leaveTimeM
Leave-time of the vehicle in [s].
bool leftEarlyM
whether the vehicle left the detector with a lane change / teleport etc.
std::string idM
The id of the vehicle.
double entryTimeM
Entry-time of the vehicle in [s].
double speedM
Speed of the vehicle in [m/s].
std::string typeIDM
Type of the vehicle.