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].
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].
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.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
~MSInstantInductLoop()
Destructor.
Representation of a vehicle.
bool writeXMLHeader(const std::string &rootElement, const std::string &schemaFile, std::map< SumoXMLAttr, std::string > attrs=std::map< SumoXMLAttr, std::string >())
Writes an XML header with optional configuration.
virtual SUMOReal getSpeed() const =0
Returns the vehicle's current speed.
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.
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.
OutputDevice & myOutputDevice
The output device to use.
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.
virtual const std::string & getID() const =0
Get the vehicle's ID.
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
virtual SUMOReal getPreviousSpeed() const =0
Returns the vehicle's previous speed.
Representation of a lane in the micro simulation.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
Base of value-generating classes (detectors)