48 #ifdef CHECK_MEMORY_LEAKS 50 #endif // CHECK_MEMORY_LEAKS 61 myPosition(positionInMeters), myLastExitTime(-1) {
62 assert(
myPosition >= 0 && myPosition <= myLane->getLength());
88 write(
"enter", entryTime, veh, newSpeed);
93 std::map<SUMOVehicle*, SUMOReal>::iterator i =
myEntryTimes.find(&veh);
97 write(
"leave", leaveTime, veh, newSpeed,
"occupancy", leaveTime - (*i).second);
113 "vehID", veh.
getID()).writeAttr(
"speed",
toString(speed)).writeAttr(
130 std::map<SUMOVehicle*, SUMOReal>::iterator i =
myEntryTimes.find(&veh);
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
MSInstantInductLoop(const std::string &id, OutputDevice &od, MSLane *const lane, SUMOReal positionInMeters)
Constructor.
The vehicle arrived at a junction.
Notification
Definition of a vehicle state.
SUMOReal getLength() const
Get vehicle's length [m].
bool notifyLeave(SUMOVehicle &veh, SUMOReal lastPos, MSMoveReminder::Notification reason)
Dismisses the vehicle if it is on the detector due to a lane change.
void write(const char *state, SUMOReal t, SUMOVehicle &veh, SUMOReal speed, const char *add=0, SUMOReal addValue=-1)
Writes an event line.
SUMOReal myLastExitTime
The last exit time.
const SUMOReal myPosition
Detector's position on lane [m].
bool writeXMLHeader(const std::string &rootElement, const std::string &attrs="", const std::string &comment="")
Writes an XML header with optional configuration.
const std::string & getID() const
Returns the id.
std::map< SUMOVehicle *, SUMOReal > myEntryTimes
The last exit time.
~MSInstantInductLoop()
Destructor.
Representation of a vehicle.
Something on a lane to be noticed about vehicle movement.
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
OutputDevice & myOutputDevice
The output device to use.
virtual SUMOReal getSpeed() const =0
Returns the vehicle's current speed.
const std::string & getID() const
Returns the name of the vehicle type.
bool notifyMove(SUMOVehicle &veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal 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.
void writeXMLDetectorProlog(OutputDevice &dev) const
Open the XML-output.
bool closeTag()
Closes the most recently opened tag.
Representation of a lane in the micro simulation.
virtual const std::string & getID() const =0
Get the vehicle's ID.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
Base of value-generating classes (detectors)
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.