39 #ifdef CHECK_MEMORY_LEAKS
41 #endif // CHECK_MEMORY_LEAKS
54 into.push_back(device);
63 :
MSDevice(holder, id), myDepartLane(
""), myDepartPos(-1), myDepartSpeed(-1),
64 myWaitingSteps(0), myArrivalTime(-1), myArrivalLane(
""), myArrivalPos(-1), myArrivalSpeed(-1) {
131 std::ostringstream str;
132 for (std::vector<MSDevice*>::const_iterator i = devices.begin(); i != devices.end(); ++i) {
133 if (i != devices.begin()) {
136 str << (*i)->getID();
SUMOTime myArrivalTime
The vehicle's arrival time.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Representation of a vehicle in the micro simulation.
virtual const MSRoute & getRoute() const =0
Returns the current route.
A device which collects info on the vehicle trip (mainly on departure and arrival) ...
SUMOVehicle & myHolder
The vehicle that stores the device.
virtual SUMOReal getPositionOnLane() const =0
Get the vehicle's position along the lane.
virtual const MSEdge * getEdge() const =0
Returns the edge the vehicle is currently at.
Notification
Definition of a vehicle state.
std::string time2string(SUMOTime t)
void generateOutput() const
Called on writing tripinfo output.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSDevice * > &into)
Build devices for the given vehicle, if needed.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
SUMOReal myArrivalPos
The position on the lane the vehicle arrived at.
~MSDevice_Tripinfo()
Destructor.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step (in s)
bool notifyMove(SUMOVehicle &veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed)
Checks for waiting steps when the vehicle moves.
const MSLane * getLane() const
Returns the lane the reminder works on.
static OptionsCont & getOptions()
Retrieves the options.
SUMOReal myDepartSpeed
The speed on departure.
SUMOReal myArrivalSpeed
The speed when arriving.
const std::string & getID() const
Returns the id.
bool notifyEnter(SUMOVehicle &veh, MSMoveReminder::Notification reason)
Saves departure info on insertion.
virtual const std::vector< MSDevice * > & getDevices() const =0
Returns this vehicle's devices.
Representation of a vehicle.
unsigned int myWaitingSteps
The overall number of waiting steps.
The vehicle arrived at its destination (is deleted)
SUMOTime depart
The vehicle's departure time.
SUMOReal myDepartPos
The position on the lane the vehicle departed at.
SUMOReal getLength() const
std::string myDepartLane
The lane the vehicle departed at.
Abstract in-vehicle device.
static bool dictionary(const std::string &id, MSLane *lane)
Static (sic!) container methods {.
The vehicle has departed (was inserted into the network)
virtual SUMOReal getSpeed() const =0
Returns the vehicle's current speed.
MSRouteIterator end() const
Returns the end of the list of edges to pass.
std::string myArrivalLane
The lane the vehicle arrived at.
virtual SUMOTime getDeparture() const =0
Returns this vehicle's real departure time.
static OutputDevice & getDeviceByOption(const std::string &name)
Returns the device described by the option.
virtual const SUMOVehicleParameter & getParameter() const =0
Returns the vehicle's parameter (including departure definition)
MSDevice_Tripinfo()
dummy constructor
const SUMOReal SUMO_const_haltingSpeed
the speed threshold at which vehicles are considered as halting
const std::string & getID() const
Returns the name of the vehicle type.
Static storage of an output device and its base (abstract) implementation.
bool notifyLeave(SUMOVehicle &veh, SUMOReal lastPos, MSMoveReminder::Notification reason)
Saves arrival info.
static const bool gUseMesoSim
virtual SUMOReal getArrivalPos() const =0
Returns this vehicle's desired arrivalPos for its current route (may change on reroute) ...
virtual unsigned int getNumberReroutes() const =0
Returns the number of new routes this vehicle got.
virtual const std::string & getID() const =0
Get the vehicle's ID.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.