38 #define NOT_ARRIVED TIME2STEPS(-1) 78 into.push_back(device);
139 double ,
double newSpeed) {
158 const double timeOnLane,
160 const double meanSpeedVehicleOnLane,
262 os.
writeAttr(
"routeLength", routeLength);
289 if (writeTripinfos) {
327 if (rideDuration > 0) {
333 }
else if (!line.empty()) {
349 std::ostringstream msg;
352 msg <<
"Statistics (avg):\n" 362 msg <<
"Pedestrian Statistics (avg of " <<
myWalkCount <<
" walks):\n" 368 msg <<
"Ride Statistics (avg of " <<
myRideCount <<
" rides):\n" 490 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
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) ...
bool hasPersons() const
Returns whether persons are simulated.
A vehicle from the mesoscopic point of view.
static SUMOTime myTotalWaitingTime
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
double getVehicleMaxSpeed(const SUMOTrafficObject *const veh) const
Returns the maximum speed the vehicle may use on this edge.
virtual const std::string & getID() const =0
Get the vehicle's ID.
virtual const MSRoute & getRoute() const =0
Returns the current route.
static double myTotalRouteLength
A device which collects info on the vehicle trip (mainly on departure and arrival) ...
int gPrecision
the precision for floating point outputs
static double getAvgTimeLoss()
The vehicle arrived at a junction.
bool notifyLeave(SUMOTrafficObject &veh, double lastPos, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Saves arrival info.
virtual const MSEdge * getEdge() const =0
Returns the edge the vehicle is currently at.
Notification
Definition of a vehicle state.
SUMOVehicle & myHolder
The vehicle that stores the device.
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(SUMOVehicle &holder, const std::string &id)
Constructor.
~MSDevice_Tripinfo()
Destructor.
double getLength() const
Returns the lane's length.
The vehicle got vaporized.
static double myVehicleCount
global tripinfo statistics
const std::string & getID() const
Returns the id.
static SUMOTime myWaitingDepartDelay
bool isRailway(SVCPermissions permissions)
Returns whether an edge with the given permission is a railway edge.
SUMOTime myStoppingTime
The overall intentional stopping time.
virtual double getChosenSpeedFactor() const =0
double getLength() const
return the length of the edge
static double getAvgRideWaitingTime()
static std::set< const MSDevice_Tripinfo *, ComparatorNumericalIdLess > myPendingOutput
devices which may still need to produce output
double myArrivalSpeed
The speed when arriving.
The simulated network and simulation perfomer.
virtual void erase(MSTransportable *transportable)
removes a single transportable
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 double getAvgWalkTimeLoss()
int myWaitingCount
The overall number of unintended stops.
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
double getCurrentStoppingTimeSeconds() const
Returns the delay that is accrued due to option –meso-tls-penalty or –meso-minor-penalty.
static void generateOutputForUnfinished()
generate output for vehicles which are still in the network
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 MSTransportableControl & getPersonControl()
Returns the person control.
virtual int getNumberReroutes() const =0
Returns the number of new routes this vehicle got.
SUMOTime myParkingStarted
The time when parking started.
static SUMOTime myTotalDuration
virtual const std::vector< MSVehicleDevice * > & getDevices() const =0
Returns this vehicle's devices.
constVehIt loadedBegin() const
Returns the begin of the internal transportables map.
The vehicle arrived at its destination (is deleted)
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
static double myTotalRideWaitingTime
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice *> &into)
Build devices for the given vehicle, if needed.
double myArrivalPosLat
The lateral position on the lane the vehicle arrived at.
static double getAvgWalkDuration()
std::string myDepartLane
The lane the vehicle departed at.
static void cleanup()
resets counters
static SUMOTime myTotalRideDuration
static double getAvgRideDuration()
static double getAvgWaitingTime()
virtual double getDepartPos() const =0
Returns this vehicle's real departure position.
virtual SUMOTime getDepartDelay() const =0
The vehicle starts or ends parking.
The vehicle has departed (was inserted into the network)
static double myTotalWalkRouteLength
Representation of a vehicle or person.
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.
double myDepartSpeed
The speed on departure.
virtual const SUMOVehicleParameter & getParameter() const =0
Returns the vehicle's parameter (including departure definition)
static SUMOTime myTotalDepartDelay
bool notifyEnter(SUMOTrafficObject &veh, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Saves departure info on insertion.
const std::string & getID() const
Returns the name of the vehicle type.
constVehIt loadedEnd() const
Returns the end of the internal transportables map.
Abstract in-vehicle device.
static double getAvgRouteLength()
accessors for GUINet-Parameters
static double myTotalRideRouteLength
double myRouteLength
The route length.
const double SUMO_const_haltingSpeed
the speed threshold at which vehicles are considered as halting
bool notifyMove(SUMOTrafficObject &veh, double oldPos, double newPos, double newSpeed)
Checks for waiting steps when the vehicle moves.
static double getAvgDepartDelay()
static int myRideAbortCount
virtual double getPositionOnLane() const =0
Get the vehicle's position along the lane.
Static storage of an output device and its base (abstract) implementation.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
static int myRideRailCount
void generateOutput() const
Called on writing tripinfo output.
void notifyMoveInternal(const SUMOTrafficObject &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() ...
static SUMOTime myTotalTimeLoss
SUMOTime myMesoTimeLoss
The time loss when compared to the desired and allowed speed.
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.
virtual bool isStopped() const =0
Returns whether the vehicle is at a stop.
double myArrivalPos
The position on the lane the vehicle arrived at.
MSRouteIterator end() const
Returns the end of the list of edges to pass.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
void saveState(OutputDevice &out) const
Saves the state of the device.
bool myAmWaiting
Whether the vehicle is currently waiting.
The vehicle is being teleported.
virtual SUMOTime getWaitingTime() const =0