48 const std::string name,
const std::string& vTypes,
49 const std::string& nextEdges) :
66 double newPos,
double newSpeed) {
83 const double entryTime =
SIMTIME -
TS + timeBeforeEnter;
88 write(
"enter", entryTime, veh, enterSpeed);
95 std::map<SUMOTrafficObject*, double>::iterator i =
myEntryTimes.find(&veh);
99 const double leaveTime =
SIMTIME -
TS + timeBeforeLeave;
100 write(
"leave", leaveTime, veh, newSpeed,
"occupancy", leaveTime - (*i).second);
116 "id",
getID()).writeAttr(
"time",
toString(t)).writeAttr(
"state", state).writeAttr(
117 "vehID", veh.
getID()).writeAttr(
"speed",
toString(speed)).writeAttr(
120 if (add !=
nullptr) {
135 std::map<SUMOTrafficObject*, double>::iterator i =
myEntryTimes.find(&veh);
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static double speedAfterTime(const double t, const double oldSpeed, const double dist)
Calculates the speed after a time t \in [0,TS] given the initial speed and the distance traveled in a...
static double passingTime(const double lastPos, const double passedPos, const double currentPos, const double lastSpeed, const double currentSpeed)
Calculates the time at which the position passedPosition has been passed In case of a ballistic updat...
bool vehicleApplies(const SUMOTrafficObject &veh) const
Checks whether the detector measures vehicles of the given type.
MSDetectorFileOutput(const std::string &id, const std::string &vTypes, const std::string &nextEdges="", const int detectPersons=false)
Constructor.
static bool gSemiImplicitEulerUpdate
static int gNumSimThreads
how many threads to use for simulation
std::map< SUMOTrafficObject *, double > myEntryTimes
The last exit time.
OutputDevice & myOutputDevice
The output device to use.
void writeXMLDetectorProlog(OutputDevice &dev) const
Open the XML-output.
~MSInstantInductLoop()
Destructor.
void write(const char *state, double t, SUMOTrafficObject &veh, double speed, const char *add=0, double addValue=-1)
Writes an event line.
const double myPosition
Detector's position on lane [m].
MSInstantInductLoop(const std::string &id, OutputDevice &od, MSLane *const lane, double positionInMeters, const std::string name, const std::string &vTypes, const std::string &nextEdges)
Constructor.
const std::string myName
name
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 myLastExitTime
The last exit 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.
Representation of a lane in the micro simulation.
Notification
Definition of a vehicle state.
@ NOTIFICATION_JUNCTION
The vehicle arrived at a junction.
MSMoveReminder(const std::string &description, MSLane *const lane=nullptr, const bool doAdd=true)
Constructor.
const std::string & getID() const
Returns the name of the vehicle type.
double getLength() const
Get vehicle's length [m].
const std::string & getID() const
Returns the id.
Static storage of an output device and its base (abstract) implementation.
bool writeXMLHeader(const std::string &rootElement, const std::string &schemaFile, std::map< SumoXMLAttr, std::string > attrs=std::map< SumoXMLAttr, std::string >(), bool includeConfig=true)
Writes an XML header with optional configuration.
Representation of a vehicle, person, or container.
virtual const MSVehicleType & getVehicleType() const =0
Returns the object's "vehicle" type.
virtual double getPreviousSpeed() const =0
Returns the object's previous speed.
virtual double getSpeed() const =0
Returns the object's current speed.
A scoped lock which only triggers on condition.