 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
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;
VehicleData(const std::string &id, double vehLength, double entryTimestep, double leaveTimestep, const std::string &typeID)
Constructor.
Representation of a vehicle or person.
double getPosition() const
Returns the position of the detector on the lane.
Base of value-generating classes (detectors)
double myLastLeaveTime
Leave-time of the last vehicle detected [s].
Representation of a lane in the micro simulation.
double getCurrentLength() const
Returns the length of the vehicle on the detector.
Struct to store the data of the counted vehicle internally.
std::deque< VehicleData > VehicleDataCont
Type of myVehicleDataCont.
virtual void enterDetectorByMove(SUMOTrafficObject &veh, double entryTimestep)
Introduces a vehicle to the detector's map myVehiclesOnDet.
static double lengthSum(double sumSoFar, const MSInductLoop::VehicleData &data)
Adds up VehicleData::lengthM.
Static storage of an output device and its base (abstract) implementation.
std::string typeIDM
Type of the vehicle in.
An unextended detector measuring at a fixed position on a fixed lane.
double getCurrentSpeed() const
Returns the speed of the vehicle on the detector.
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.
virtual void leaveDetectorByLaneChange(SUMOTrafficObject &veh, double lastPos)
Removes a vehicle from the detector's map myVehiclesOnDet.
std::string idM
The id of the vehicle.
double myLastOccupancy
Occupancy by the last vehicle detected.
Something on a lane to be noticed about vehicle movement.
double getCurrentOccupancy() const
Returns the current occupancy.
double speedM
Speed of the vehicle in [m/s].
virtual void leaveDetectorByMove(SUMOTrafficObject &veh, double leaveTimestep)
Processes a vehicle that leaves the detector.
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 lengthM
Length of the vehicle.
int getCurrentPassedNumber() const
Returns the number of vehicles that have passed the detector.
static double speedSum(double sumSoFar, const MSInductLoop::VehicleData &data)
Adds up VehicleData::speedM.
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.
std::vector< std::string > getCurrentVehicleIDs() const
Returns the ids of vehicles that have passed 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.
virtual void setVisible(bool)
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.
double leaveTimeM
Leave-time of the vehicle in [s].
VehicleDataCont myLastVehicleDataCont
Data of vehicles that have completely passed the detector in the last time interval.
~MSInductLoop()
Destructor.
const double myPosition
Detector's position on lane [m].
void writeXMLOutput(OutputDevice &dev, SUMOTime startTime, SUMOTime stopTime)
Writes collected values into the given stream.
MSInductLoop(const std::string &id, MSLane *const lane, double positionInMeters, const std::string &vTypes)
Constructor.
VehicleDataCont myVehicleDataCont
Data of vehicles that have completely passed the detector.
int myEnteredVehicleNumber
The number of entered vehicles.
Notification
Definition of a vehicle state.
virtual void reset()
Resets all generated values to allow computation of next interval.
std::map< SUMOTrafficObject *, double > VehicleMap
Type of myVehiclesOnDet.
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].
Representation of a vehicle in the micro simulation.