42 #define NOT_ARRIVED TIME2STEPS(-1) 81 into.push_back(device);
136 double ,
double newSpeed) {
149 const double timeOnLane,
151 const double meanSpeedVehicleOnLane,
203 double finalPosOnInternal = 0;
210 finalPosOnInternal = finalPos;
257 os.
writeAttr(
"routeLength", routeLength);
262 std::ostringstream str;
263 for (std::vector<MSDevice*>::const_iterator i = devices.begin(); i != devices.end(); ++i) {
264 if (i != devices.begin()) {
267 str << (*i)->getID();
321 if (rideDuration > 0) {
343 std::ostringstream msg;
346 msg <<
"Statistics (avg):\n" 353 msg <<
"Pedestrian Statistics (avg of " <<
myWalkCount <<
" walks):\n" 359 msg <<
"Ride Statistics (avg of " <<
myRideCount <<
" rides):\n" 481 std::vector<std::string> internals;
static SUMOTime myTotalWalkDuration
static double getAvgRideRouteLength()
static int myRideBikeCount
static SUMOTime myTotalWalkTimeLoss
static double gLateralResolution
const MSLane * getLane() const
Returns the lane the reminder works on.
SUMOTime myArrivalTime
The vehicle's arrival time.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
void computeLengthAndDuration(double &routeLength, SUMOTime &duration) const
MSEdge & getEdge() const
Returns the lane's edge.
Representation of a vehicle in the micro simulation.
static void addPedestrianData(double walkLength, SUMOTime walkDuration, SUMOTime walkTimeLoss)
record tripinfo data for pedestrians
virtual bool hasDeparted() const =0
Returns whether this vehicle has departed.
virtual double getArrivalPos() const =0
Returns this vehicle's desired arrivalPos for its current route (may change on reroute) ...
static SUMOTime myTotalWaitingTime
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
bool notifyEnter(SUMOVehicle &veh, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Saves departure info on insertion.
virtual const MSRoute & getRoute() const =0
Returns the current route.
void updateStatistics(SUMOTime timeLoss) const
update tripinfo statistics
static double myTotalRouteLength
bool notifyLeave(SUMOVehicle &veh, double lastPos, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Saves arrival info.
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
static double getAvgTimeLoss()
virtual const MSEdge * getEdge() const =0
Returns the edge the vehicle is currently at.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSDevice *> &into)
Build devices for the given vehicle, if needed.
Notification
Definition of a vehicle state.
double getDistanceBetween(double fromPos, double 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 void addRideData(double rideLength, SUMOTime rideDuration, SUMOVehicleClass vClass, const std::string &line, SUMOTime waitingTime)
record tripinfo data for rides
std::string time2string(SUMOTime t)
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
~MSDevice_Tripinfo()
Destructor.
The vehicle got vaporized.
static double myVehicleCount
global tripinfo statistics
const std::string & getID() const
Returns the id.
bool isRailway(SVCPermissions permissions)
Returns whether an edge with the given permission is a railway edge.
double getLength() const
return the length of the edge
static double getAvgRideWaitingTime()
std::set< const MSDevice_Tripinfo *, ComparatorIdLess > DeviceSet
devices which may still need to produce output
double myArrivalSpeed
The speed when arriving.
static int myRideBusCount
static OptionsCont & getOptions()
Retrieves the options.
static double getAvgDuration()
SUMOTime myWaitingTime
The overall waiting time.
virtual std::string getString(int id) const =0
Returns the string-value of the named (by its enum-value) attribute.
static DeviceSet myPendingOutput
static double getAvgWalkTimeLoss()
virtual const std::vector< MSDevice * > & getDevices() const =0
Returns this vehicle's devices.
static void generateOutputForUnfinished()
generate output for vehicles which are still in the network
void notifyMoveInternal(const SUMOVehicle &veh, const double frontOnLane, const double timeOnLane, const double meanSpeedFrontOnLane, const double meanSpeedVehicleOnLane, const double travelledDistanceFrontOnLane, const double travelledDistanceVehicleOnLane, const double)
Internal notification about the vehicle moves, see MSMoveReminder::notifyMoveInternal() ...
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static std::string printStatistics()
get statistics for printing to stdout
Representation of a vehicle.
static double getAvgWalkRouteLength()
Encapsulated SAX-Attributes.
virtual int getNumberReroutes() const =0
Returns the number of new routes this vehicle got.
static SUMOTime myTotalDuration
The vehicle arrived at its destination (is deleted)
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
static double myTotalRideWaitingTime
bool hasInternalLinks() const
return whether the network contains internal links
static bool gUsingInternalLanes
Information whether the simulation regards internal lanes.
double myArrivalPosLat
The lateral position on the lane the vehicle arrived at.
static double getAvgWalkDuration()
bool isInternal() const
return whether this edge is an internal edge
virtual double getChosenSpeedFactor() const =0
std::string myDepartLane
The lane the vehicle departed at.
double getVehicleMaxSpeed(const SUMOVehicle *const veh) const
Returns the maximum speed the vehicle may use on this edge.
static void cleanup()
resets counters
static SUMOTime myTotalRideDuration
static double getAvgRideDuration()
Abstract in-vehicle device.
static double getAvgWaitingTime()
virtual double getDepartPos() const =0
Returns this vehicle's real departure position.
virtual SUMOTime getDepartDelay() const =0
The vehicle has departed (was inserted into the network)
bool notifyMove(SUMOVehicle &veh, double oldPos, double newPos, double newSpeed)
Checks for waiting steps when the vehicle moves.
static double myTotalWalkRouteLength
std::string myArrivalLane
The lane the vehicle arrived at.
virtual SUMOTime getDeparture() const =0
Returns this vehicle's real departure time.
virtual double getPositionOnLane() const =0
Get the vehicle's position along the lane.
static OutputDevice & getDeviceByOption(const std::string &name)
Returns the device described by the option.
double myDepartSpeed
The speed on departure.
MSDevice_Tripinfo()
dummy constructor
static SUMOTime myTotalDepartDelay
const std::string & getID() const
Returns the name of the vehicle type.
virtual SUMOTime getWaitingTime() const =0
static double getAvgRouteLength()
accessors for GUINet-Parameters
static double myTotalRideRouteLength
const double SUMO_const_haltingSpeed
the speed threshold at which vehicles are considered as halting
static double getAvgDepartDelay()
static int myRideAbortCount
virtual bool isStopped() const =0
Returns whether the vehicle is at a stop.
Static storage of an output device and its base (abstract) implementation.
bool closeTag()
Closes the most recently opened tag.
static int myRideRailCount
MSRouteIterator begin() const
Returns the begin of the list of edges to pass.
void generateOutput() const
Called on writing tripinfo output.
static SUMOTime myTotalTimeLoss
SUMOTime myMesoTimeLoss
The time loss when compared to the desired and allowed speed.
virtual const ConstMSEdgeVector::const_iterator & getCurrentRouteEdge() const =0
Returns an iterator pointing to the current edge in this vehicles route.
double myDepartPosLat
The lateral depart position.
virtual double getSpeed() const =0
Returns the vehicle's current speed.
void loadState(const SUMOSAXAttributes &attrs)
Loads the state of the device from the given description.
Representation of a lane in the micro simulation.
double myArrivalPos
The position on the lane the vehicle arrived at.
MSRouteIterator end() const
Returns the end of the list of edges to pass.
virtual const std::string & getID() const =0
Get the vehicle's ID.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
void saveState(OutputDevice &out) const
Saves the state of the device.
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.