 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
20 #ifndef MSInductLoop_h
21 #define MSInductLoop_h
77 double positionInMeters,
78 const std::string& vTypes);
162 double getSpeed(
const int offset)
const;
204 std::vector<std::string>
getVehicleIDs(
const int offset)
const;
259 VehicleData(
const std::string&
id,
double vehLength,
double entryTimestep,
double leaveTimestep,
260 const std::string& typeID)
329 return sumSoFar + data.
speedM;
334 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.
Struct to store the data of the counted vehicle internally.
double getVehicleLength(const int offset) const
Returns the length of the vehicle on the detector.
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.
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.
Something on a lane to be noticed about vehicle movement.
double speedM
Speed of the vehicle in [m/s].
virtual void leaveDetectorByMove(SUMOTrafficObject &veh, double leaveTimestep)
Processes a vehicle that leaves the detector.
MSInductLoop(const MSInductLoop &)
Invalidated copy constructor.
virtual void setSpecialColor(const RGBColor *)
allows for special color in the gui version
double lengthM
Length of the vehicle.
std::vector< std::string > getVehicleIDs(const int offset) const
Returns the ids 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.
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)
double getPassedNumber(const int offset) const
Returns the number of vehicles that have passed the detector.
std::map< SUMOTrafficObject *, double > myVehiclesOnDet
Data for vehicles that have entered the detector (vehicle -> enter time)
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.
double getSpeed(const int offset) const
Returns the speed of the vehicle on the detector.
~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.
double getOccupancy() const
Returns the current occupancy.
SUMOTime getLastDetectionTime() const
return last time a vehicle was on the detector
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.
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.