48 #ifdef CHECK_MEMORY_LEAKS
50 #endif // CHECK_MEMORY_LEAKS
58 const std::string& vTypes) :
62 myPosition(positionInMeters), myLastExitTime(-1) {
63 assert(
myPosition >= 0 && myPosition <= myLane->getLength());
93 write(
"enter", entryTime, veh, enterSpeed);
100 std::map<SUMOVehicle*, SUMOReal>::iterator i =
myEntryTimes.find(&veh);
105 write(
"leave", leaveTime, veh, newSpeed,
"occupancy", leaveTime - (*i).second);
121 "vehID", veh.
getID()).writeAttr(
"speed",
toString(speed)).writeAttr(
138 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, const std::string &vTypes)
Constructor.
The vehicle arrived at a junction.
bool vehicleApplies(const SUMOVehicle &veh) const
Checks whether the detector measures vehicles of the given type.
Notification
Definition of a vehicle state.
SUMOReal getLength() const
Get vehicle's length [m].
virtual SUMOReal getPreviousSpeed() const =0
Returns the vehicle's previous speed.
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.
static SUMOReal speedAfterTime(const SUMOReal t, const SUMOReal oldSpeed, const SUMOReal dist)
Calculates the speed after a time t [0,TS] given the initial speed and the distance traveled in an i...
std::map< SUMOVehicle *, SUMOReal > myEntryTimes
The last exit time.
~MSInstantInductLoop()
Destructor.
Representation of a vehicle.
static SUMOReal passingTime(const SUMOReal lastPos, const SUMOReal passedPos, const SUMOReal currentPos, const SUMOReal lastSpeed, const SUMOReal currentSpeed)
Calculates the time at which the position passedPosition has been passed In case of a ballistic updat...
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.
static bool gSemiImplicitEulerUpdate
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.