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)
323 return sumSoFar + data.
speedM;
328 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.
std::vector< std::string > getCurrentVehicleIDs() const
Returns the ids of vehicles that have passed the detector.
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.
double getCurrentLength() const
Returns the length of the vehicle on the detector.
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.
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.
Representation of a vehicle.
~MSInductLoop()
Destructor.
virtual void enterDetectorByMove(SUMOVehicle &veh, double entryTimestep)
Introduces a vehicle to the detector's map myVehiclesOnDet.
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].
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.
bool notifyEnter(SUMOVehicle &veh, Notification reason, const MSLane *enteredLane=0)
Checks whether the reminder is activated by a vehicle entering the lane.
int getCurrentPassedNumber() const
Returns the number of vehicles that have passed the detector.
Struct to store the data of the counted vehicle internally.
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.
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.