21 #ifndef MSInductLoop_h 22 #define MSInductLoop_h 78 double positionInMeters,
79 const std::string& vTypes);
257 VehicleData(
const std::string&
id,
double vehLength,
double entryTimestep,
double leaveTimestep,
258 const std::string& typeID)
327 return sumSoFar + data.
speedM;
332 return sumSoFar + data.
lengthM;
const double myPosition
Detector's position on lane [m].
void writeXMLOutput(OutputDevice &dev, SUMOTime startTime, SUMOTime stopTime)
Writes collected values into the given stream.
Representation of a vehicle in the micro simulation.
virtual void leaveDetectorByMove(SUMOTrafficObject &veh, double leaveTimestep)
Processes a vehicle that leaves 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.
virtual void leaveDetectorByLaneChange(SUMOTrafficObject &veh, double lastPos)
Removes a vehicle from the detector's map myVehiclesOnDet.
double myLastOccupancy
Occupancy by the last vehicle detected.
std::vector< std::string > getCurrentVehicleIDs() const
Returns the ids of vehicles that have passed the detector.
virtual void reset()
Resets all generated values to allow computation of next interval.
static double speedSum(double sumSoFar, const MSInductLoop::VehicleData &data)
Adds up VehicleData::speedM.
Notification
Definition of a vehicle state.
virtual void setVisible(bool)
double getCurrentLength() const
Returns the length of the vehicle on the detector.
bool notifyMove(SUMOTrafficObject &veh, double oldPos, double newPos, double newSpeed)
Checks whether the vehicle shall be counted and/or shall still touch this MSMoveReminder.
VehicleMap myVehiclesOnDet
Data for vehicles that have entered the detector (vehicle -> enter time)
virtual void setSpecialColor(const RGBColor *)
allows for special color in the gui version
double speedM
Speed of the vehicle in [m/s].
VehicleDataCont myLastVehicleDataCont
Data of vehicles that have completely passed the detector in the last time interval.
VehicleDataCont myVehicleDataCont
Data of vehicles that have completely passed the detector.
std::deque< VehicleData > VehicleDataCont
Type of myVehicleDataCont.
MSInductLoop & operator=(const MSInductLoop &)
Invalidated assignment operator.
void writeXMLDetectorProlog(OutputDevice &dev) const
Opens the XML-output using "detector" as root element.
double entryTimeM
Entry-time of the vehicle in [s].
VehicleData(const std::string &id, double vehLength, double entryTimestep, double leaveTimestep, const std::string &typeID)
Constructor.
~MSInductLoop()
Destructor.
double getCurrentSpeed() const
Returns the speed of the vehicle on the detector.
double getPosition() const
Returns the position of the detector on the lane.
double lengthM
Length of the vehicle.
std::string idM
The id of the vehicle.
Something on a lane to be noticed about vehicle movement.
double leaveTimeM
Leave-time of the vehicle in [s].
bool notifyEnter(SUMOTrafficObject &veh, Notification reason, const MSLane *enteredLane=0)
Checks whether the reminder is activated by a vehicle entering the lane.
double getTimeSinceLastDetection() const
Returns the time since the last vehicle left the detector.
MSInductLoop(const std::string &id, MSLane *const lane, double positionInMeters, const std::string &vTypes)
Constructor.
int myEnteredVehicleNumber
The number of entered vehicles.
virtual void enterDetectorByMove(SUMOTrafficObject &veh, double entryTimestep)
Introduces a vehicle to the detector's map myVehiclesOnDet.
int getCurrentPassedNumber() const
Returns the number of vehicles that have passed the detector.
std::map< SUMOTrafficObject *, double > VehicleMap
Type of myVehiclesOnDet.
Struct to store the data of the counted vehicle internally.
Representation of a vehicle or person.
Static storage of an output device and its base (abstract) implementation.
virtual std::vector< VehicleData > collectVehiclesOnDet(SUMOTime t, bool leaveTime=false) const
Returns vehicle data for vehicles that have been on the detector starting at the given time...
double getCurrentOccupancy() const
Returns the current occupancy.
double myLastLeaveTime
Leave-time of the last vehicle detected [s].
Representation of a lane in the micro simulation.
static double lengthSum(double sumSoFar, const MSInductLoop::VehicleData &data)
Adds up VehicleData::lengthM.
Base of value-generating classes (detectors)
std::string typeIDM
Type of the vehicle in.
An unextended detector measuring at a fixed position on a fixed lane.