 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
38 #define NOT_ARRIVED TIME2STEPS(-1)
78 into.push_back(device);
139 double ,
double newSpeed) {
158 const double timeOnLane,
160 const double meanSpeedVehicleOnLane,
166 const MEVehicle* mesoVeh = dynamic_cast<const MEVehicle*>(&veh);
181 myDepartLane = static_cast<MSVehicle&>(veh).getLane()->getID();
182 myDepartPosLat = static_cast<MSVehicle&>(veh).getLateralPositionOnLane();
201 myArrivalLane = static_cast<MSVehicle&>(veh).getLane()->getID();
202 myArrivalPosLat = static_cast<MSVehicle&>(veh).getLateralPositionOnLane();
219 myRouteLength += static_cast<MSVehicle&>(veh).getLane()->getLength();
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 myTotalDepartDelay
static double getAvgRideDuration()
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
A vehicle from the mesoscopic point of view.
static void cleanup()
resets counters
Representation of a vehicle or person.
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
SUMOTime myStoppingTime
The overall intentional stopping time.
static double getAvgWaitingTime()
virtual SUMOTime getWaitingTime() const =0
const std::string & getID() const
Returns the name of the vehicle type.
virtual SUMOTime getDepartDelay() const =0
int myWaitingCount
The overall number of unintended stops.
double myArrivalSpeed
The speed when arriving.
Representation of a lane in the micro simulation.
double myRouteLength
The route length.
double getVehicleMaxSpeed(const SUMOTrafficObject *const veh) const
Returns the maximum speed the vehicle may use on this edge.
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 getAvgWalkRouteLength()
virtual const SUMOVehicleParameter & getParameter() const =0
Returns the vehicle's parameter (including departure definition)
Static storage of an output device and its base (abstract) implementation.
double myDepartSpeed
The speed on departure.
MSRouteIterator end() const
Returns the end of the list of edges to pass.
virtual const MSEdge * getEdge() const =0
Returns the edge the vehicle is currently at.
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.
virtual const std::string & getID() const =0
Get the vehicle's ID.
virtual void erase(MSTransportable *transportable)
removes a single transportable
The simulated network and simulation perfomer.
double myDepartPosLat
The lateral depart position.
double myArrivalPos
The position on the lane the vehicle arrived at.
static int myRideRailCount
void loadState(const SUMOSAXAttributes &attrs)
Loads the state of the device from the given description.
Representation of a vehicle.
static OptionsCont & getOptions()
Retrieves the options.
SUMOTime myParkingStarted
The time when parking started.
void saveState(OutputDevice &out) const
Saves the state of the device.
bool hasPersons() const
Returns whether persons are simulated.
double getCurrentStoppingTimeSeconds() const
Returns the delay that is accrued due to option –meso-tls-penalty or –meso-minor-penalty.
SUMOTime myArrivalTime
The vehicle's arrival time.
SUMOTime myMesoTimeLoss
The time loss when compared to the desired and allowed speed.
SUMOVehicle & myHolder
The vehicle that stores the device.
static SUMOTime myTotalRideDuration
double getLength() const
return the length of the edge
const double SUMO_const_haltingSpeed
the speed threshold at which vehicles are considered as halting
static double gLateralResolution
static void addPedestrianData(double walkLength, SUMOTime walkDuration, SUMOTime walkTimeLoss)
record tripinfo data for pedestrians
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
The vehicle got vaporized.
static double getAvgRideRouteLength()
virtual double getChosenSpeedFactor() const =0
static double getAvgWalkDuration()
A device which collects info on the vehicle trip (mainly on departure and arrival)
virtual SUMOTime getDeparture() const =0
Returns this vehicle's real departure time.
virtual const MSRoute & getRoute() const =0
Returns the current route.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
static double myTotalRouteLength
bool notifyEnter(SUMOTrafficObject &veh, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Saves departure info on insertion.
static double getAvgTimeLoss()
bool notifyLeave(SUMOTrafficObject &veh, double lastPos, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Saves arrival info.
std::string myArrivalLane
The lane the vehicle arrived at.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
static double myTotalRideRouteLength
static double getAvgRouteLength()
accessors for GUINet-Parameters
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
static int myRideAbortCount
bool notifyMove(SUMOTrafficObject &veh, double oldPos, double newPos, double newSpeed)
Checks for waiting steps when the vehicle moves.
bool isRailway(SVCPermissions permissions)
Returns whether an edge with the given permission is a railway edge.
constVehIt loadedBegin() const
Returns the begin of the internal transportables map.
std::string time2string(SUMOTime t)
static SUMOTime myTotalTimeLoss
static double myVehicleCount
global tripinfo statistics
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 std::set< const MSDevice_Tripinfo *, ComparatorNumericalIdLess > myPendingOutput
devices which may still need to produce output
The vehicle has departed (was inserted into the network)
static double getAvgDepartDelay()
static int myRideBusCount
void generateOutput() const
Called on writing tripinfo output.
static int myRideBikeCount
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static void generateOutputForUnfinished()
generate output for vehicles which are still in the network
The vehicle starts or ends parking.
static double getAvgRideWaitingTime()
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
constVehIt loadedEnd() const
Returns the end of the internal transportables map.
virtual MSTransportableControl & getPersonControl()
Returns the person control.
bool myAmWaiting
Whether the vehicle is currently waiting.
virtual bool hasDeparted() const =0
Returns whether this vehicle has departed.
The vehicle arrived at its destination (is deleted)
static std::string printStatistics()
get statistics for printing to stdout
static SUMOTime myTotalWalkDuration
static double getAvgWalkTimeLoss()
virtual int getNumberReroutes() const =0
Returns the number of new routes this vehicle got.
static SUMOTime myTotalWalkTimeLoss
static SUMOTime myTotalDuration
virtual double getArrivalPos() const =0
Returns this vehicle's desired arrivalPos for its current route (may change on reroute)
static SUMOTime myTotalWaitingTime
static double myTotalRideWaitingTime
int gPrecision
the precision for floating point outputs
virtual const std::vector< MSVehicleDevice * > & getDevices() const =0
Returns this vehicle's devices.
virtual double getPositionOnLane() const =0
Get the vehicle's position along the lane.
MSDevice_Tripinfo(SUMOVehicle &holder, const std::string &id)
Constructor.
~MSDevice_Tripinfo()
Destructor.
std::string myDepartLane
The lane the vehicle departed at.
Encapsulated SAX-Attributes.
const std::string & getID() const
Returns the id.
Notification
Definition of a vehicle state.
static void addRideData(double rideLength, SUMOTime rideDuration, SUMOVehicleClass vClass, const std::string &line, SUMOTime waitingTime)
record tripinfo data for rides
The vehicle arrived at a junction.
virtual double getDepartPos() const =0
Returns this vehicle's real departure position.
static OutputDevice & getDeviceByOption(const std::string &name)
Returns the device described by the option.
double myArrivalPosLat
The lateral position on the lane the vehicle arrived at.
static SUMOTime myWaitingDepartDelay
The vehicle is being teleported.
virtual double getSpeed() const =0
Returns the vehicle's current speed.
static double myTotalWalkRouteLength
virtual bool isStopped() const =0
Returns whether the vehicle is at a stop.
static double getAvgDuration()
Abstract in-vehicle device.