77 double positionInMeters,
78 double length, std::string name,
79 const std::string& vTypes,
80 const std::string& nextEdges,
82 const bool needLocking);
176 double getSpeed(
const int offset)
const;
217 std::vector<std::string>
getVehicleIDs(
const int offset)
const;
298 double leaveTimestep,
const bool leftEarly,
const double detLength = 0);
324 std::vector<VehicleData>
collectVehiclesOnDet(
SUMOTime t,
bool includeEarly =
false,
bool leaveTime =
false,
bool forOccupancy =
false,
bool lastInterval =
false)
const;
340 return sumSoFar + data.
speedM;
345 return sumSoFar + data.
lengthM;
Base of value-generating classes (detectors)
bool detectPersons() const
An unextended detector measuring at a fixed position on a fixed lane.
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::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
void writeXMLOutput(OutputDevice &dev, SUMOTime startTime, SUMOTime stopTime)
Writes collected values into the given stream.
static double speedSum(double sumSoFar, const MSInductLoop::VehicleData &data)
Adds up VehicleData::speedM.
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
virtual void setSpecialColor(const RGBColor *)
allows for special color in the gui version
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
virtual void reset()
Resets all generated values to allow computation of next interval.
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.
std::string myName
detecto name
void writeXMLDetectorProlog(OutputDevice &dev) const
Opens the XML-output using "detector" as root element.
void detectorUpdate(const SUMOTime step)
Updates the detector (computes values) only used when detecting persons.
bool notifyMove(SUMOTrafficObject &veh, double oldPos, double newPos, double newSpeed)
Checks whether the vehicle shall be counted and/or shall still touch this MSMoveReminder.
void notifyMovePerson(MSTransportable *p, int dir, double pos)
helper function for mapping person movement
double myOverrideTime
overrides the time since last detection
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)
MSInductLoop & operator=(const MSInductLoop &)
Invalidated assignment operator.
const bool myNeedLock
whether internals need to be guarded against concurrent access (GUI or multi threading)
double getIntervalMeanSpeed(bool lastInterval=false) const
bool notifyEnter(SUMOTrafficObject &veh, Notification reason, const MSLane *enteredLane=0)
Checks whether the reminder is activated by a vehicle entering the lane.
virtual void clearState(SUMOTime time)
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
bool notifyLeave(SUMOTrafficObject &veh, double lastPos, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Dismisses the vehicle if it is on the detector due to a lane change.
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.
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.