24 #ifndef MSInductLoop_h 25 #define MSInductLoop_h 85 double positionInMeters,
86 const std::string& vTypes);
264 VehicleData(
const std::string&
id,
double vehLength,
double entryTimestep,
double leaveTimestep,
265 const std::string& typeID)
330 return sumSoFar + data.
speedM;
335 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.
std::map< SUMOVehicle *, double > VehicleMap
Type of myVehiclesOnDet.
double myLastOccupancy
Occupancy by the last vehicle detected.
virtual void leaveDetectorByLaneChange(SUMOVehicle &veh, double lastPos)
Removes a vehicle from the detector's map myVehiclesOnDet.
virtual void reset()
Resets all generated values to allow computation of next interval.
bool notifyLeave(SUMOVehicle &veh, double lastPos, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Dismisses the vehicle if it is on the detector due to a lane change.
static double speedSum(double sumSoFar, const MSInductLoop::VehicleData &data)
Adds up VehicleData::speedM.
virtual void leaveDetectorByMove(SUMOVehicle &veh, double leaveTimestep)
Processes a vehicle that leaves the detector.
Notification
Definition of a vehicle state.
int getCurrentPassedNumber() const
Returns the number of vehicles that have passed the detector.
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...
VehicleMap myVehiclesOnDet
Data for vehicles that have entered the detector (vehicle -> enter time)
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.
double getCurrentLength() const
Returns the length of the vehicle on the detector.
double getCurrentOccupancy() const
Returns the current occupancy.
void writeXMLDetectorProlog(OutputDevice &dev) const
Opens the XML-output using "detector" as root element.
VehicleDataCont myVehicleDataCont
Data of vehicles that have completely passed the detector.
std::deque< VehicleData > VehicleDataCont
Type of myVehicleDataCont.
std::vector< std::string > getCurrentVehicleIDs() const
Returns the ids of vehicles that have passed the detector.
double getCurrentSpeed() const
Returns the speed of the vehicle on the detector.
MSInductLoop & operator=(const MSInductLoop &)
Invalidated assignment operator.
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.
Representation of a vehicle.
~MSInductLoop()
Destructor.
double getTimeSinceLastDetection() const
Returns the time since the last vehicle left the detector.
virtual void enterDetectorByMove(SUMOVehicle &veh, double entryTimestep)
Introduces a vehicle to the detector's map myVehiclesOnDet.
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].
MSInductLoop(const std::string &id, MSLane *const lane, double positionInMeters, const std::string &vTypes)
Constructor.
int myEnteredVehicleNumber
The number of entered vehicles.
bool notifyEnter(SUMOVehicle &veh, Notification reason, const MSLane *enteredLane=0)
Checks whether the reminder is activated by a vehicle entering the lane.
Struct to store the data of the counted vehicle internally.
double getPosition() const
Returns the position of the detector on the lane.
bool notifyMove(SUMOVehicle &veh, double oldPos, double newPos, double newSpeed)
Checks whether the vehicle shall be counted and/or shall still touch this MSMoveReminder.
Static storage of an output device and its base (abstract) implementation.
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.