42 #ifdef CHECK_MEMORY_LEAKS 44 #endif // CHECK_MEMORY_LEAKS 46 #define NOT_ARRIVED TIME2STEPS(-1) 71 into.push_back(device);
118 const SUMOReal meanSpeedVehicleOnLane,
176 finalPosOnInternal = finalPos;
223 os.
writeAttr(
"routeLength", routeLength);
228 std::ostringstream str;
229 for (std::vector<MSDevice*>::const_iterator i = devices.begin(); i != devices.end(); ++i) {
230 if (i != devices.begin()) {
233 str << (*i)->getID();
278 std::ostringstream msg;
281 msg <<
"Statistics (avg):\n" SUMOTime myArrivalTime
The vehicle's arrival time.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
MSEdge & getEdge() const
Returns the lane's edge.
Representation of a vehicle in the micro simulation.
virtual SUMOTime getDeparture() const =0
Returns this vehicle's real departure time.
static SUMOTime myTotalWaitingTime
static SUMOReal getAvgDepartDelay()
virtual SUMOTime getWaitingTime() const =0
void notifyMoveInternal(const SUMOVehicle &veh, const SUMOReal frontOnLane, const SUMOReal timeOnLane, const SUMOReal meanSpeedFrontOnLane, const SUMOReal meanSpeedVehicleOnLane, const SUMOReal travelledDistanceFrontOnLane, const SUMOReal travelledDistanceVehicleOnLane)
Internal notification about the vehicle moves, see MSMoveReminder::notifyMoveInternal() ...
A device which collects info on the vehicle trip (mainly on departure and arrival) ...
SUMOVehicle & myHolder
The vehicle that stores the device.
int gPrecision
the precision for floating point outputs
virtual const ConstMSEdgeVector::const_iterator & getCurrentRouteEdge() const =0
Returns an iterator pointing to the current edge in this vehicles route.
bool hasInternalLinks() const
return whether the network contains internal links
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.
virtual const MSEdge * getEdge() const =0
Returns the edge the vehicle is currently at.
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.
The vehicle got vaporized.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
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.
virtual bool hasDeparted() const =0
Returns whether this vehicle has departed.
static OptionsCont & getOptions()
Retrieves the options.
SUMOReal myDepartSpeed
The speed on departure.
SUMOReal myArrivalSpeed
The speed when arriving.
SUMOTime myWaitingTime
The overall waiting time.
SUMOReal myArrivalPosLat
The lateral position on the lane the vehicle arrived at.
static DeviceSet myPendingOutput
static SUMOReal getAvgRouteLength()
accessors for GUINet-Parameters
const std::string & getID() const
Returns the id.
bool notifyEnter(SUMOVehicle &veh, MSMoveReminder::Notification reason)
Saves departure info on insertion.
void computeLengthAndDuration(SUMOReal &routeLength, SUMOTime &duration) const
SUMOReal getLength() const
return the length of the edge
static SUMOReal getAvgDuration()
static void generateOutputForUnfinished()
generate output for vehicles which are still in the network
SUMOReal myDepartPosLat
The lateral depart position.
virtual SUMOReal getPositionOnLane() const =0
Get the vehicle's position along the lane.
static std::string printStatistics()
get statistics for printing to stdout
Representation of a vehicle.
void updateStatistics(SUMOTime timeLoss) const
update tripinfo statistics
virtual SUMOReal getChosenSpeedFactor() const =0
SUMOReal getDistanceBetween(SUMOReal fromPos, SUMOReal toPos, const MSEdge *fromEdge, const MSEdge *toEdge, bool includeInternal=true) const
Compute the distance between 2 given edges on this route, including the length of internal lanes...
static SUMOReal getAvgWaitingTime()
static SUMOTime myTotalDuration
virtual SUMOReal getSpeed() const =0
Returns the vehicle's current speed.
static SUMOReal myTotalRouteLength
The vehicle arrived at its destination (is deleted)
virtual SUMOTime getDepartDelay() const =0
virtual bool isStopped() const =0
Returns whether the vehicle is at a stop.
static bool gUsingInternalLanes
Information whether the simulation regards internal lanes.
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.
static SUMOReal myVehicleCount
global tripinfo statistics
bool isInternal() const
return whether this edge is an internal edge
virtual int getNumberReroutes() const =0
Returns the number of new routes this vehicle got.
std::string myDepartLane
The lane the vehicle departed at.
Abstract in-vehicle device.
The vehicle has departed (was inserted into the network)
virtual const MSRoute & getRoute() const =0
Returns the current route.
MSRouteIterator end() const
Returns the end of the list of edges to pass.
std::string myArrivalLane
The lane the vehicle arrived at.
static OutputDevice & getDeviceByOption(const std::string &name)
Returns the device described by the option.
MSDevice_Tripinfo()
dummy constructor
static SUMOTime myTotalDepartDelay
static SUMOReal gLateralResolution
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.
virtual const std::string & getID() const =0
Get the vehicle's ID.
static SUMOReal getAvgTimeLoss()
virtual SUMOReal getDepartPos() const =0
Returns this vehicle's real departure position.
virtual const std::vector< MSDevice * > & getDevices() const =0
Returns this vehicle's devices.
Static storage of an output device and its base (abstract) implementation.
bool notifyLeave(SUMOVehicle &veh, SUMOReal lastPos, MSMoveReminder::Notification reason)
Saves arrival info.
bool closeTag()
Closes the most recently opened tag.
SUMOReal getVehicleMaxSpeed(const SUMOVehicle *const veh) const
Returns the maximum speed the vehicle may use on this edge.
std::set< const MSDevice_Tripinfo *, Named::NamedLikeComparatorIdLess< MSDevice_Tripinfo > > DeviceSet
devices which may still need to produce output
static SUMOTime myTotalTimeLoss
SUMOTime myMesoTimeLoss
The time loss when compared to the desired and allowed speed.
virtual SUMOReal getArrivalPos() const =0
Returns this vehicle's desired arrivalPos for its current route (may change on reroute) ...
Representation of a lane in the micro simulation.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
MSRouteIterator begin() const
Returns the begin of the list of edges to pass.