49 into.push_back(device);
59 myAmContainer(isContainer),
61 myStopped(holder.isStopped())
72 if (stage !=
nullptr) {
90 const double travelledDistanceFrontOnLane,
115 transportable->setDeparted(currentTime - freeFlowTimeCorrection);
157 if (taxiDevice !=
nullptr) {
190 transportable->setDeparted(currentTime);
209 "' from vehicle destination edge '" + veh.
getEdge()->
getID() +
237 if (taxiDevice !=
nullptr) {
256 if (taxiDevice !=
nullptr) {
267 std::vector<std::string> internals;
283 if (key ==
"IDList") {
284 std::vector<std::string> ids;
286 ids.push_back(t->getID());
#define WRITE_WARNING(msg)
std::string time2string(SUMOTime t)
convert SUMOTime to string
@ SUMO_ATTR_STATE
The state of a link.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A device which collects info on the vehicle trip (mainly on departure and arrival)
void customerArrived(const MSTransportable *person)
called by MSDevice_Transportable upon unloading a person
void customerEntered(const MSTransportable *t)
called by MSDevice_Transportable upon loading a person
~MSDevice_Transportable()
Destructor.
void saveState(OutputDevice &out) const
Saves the state of the device.
bool notifyMove(SUMOTrafficObject &veh, double oldPos, double newPos, double newSpeed)
Checks whether the vehicle is at a stop and transportable action is needed.
std::string getParameter(const std::string &key) const
try to retrieve the given parameter from this device. Throw exception for unsupported key
bool notifyLeave(SUMOTrafficObject &veh, double lastPos, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Passengers leaving on arrival.
bool anyLeavingAtStop(const MSStop &stop) const
static MSDevice_Transportable * buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into, const bool isContainer)
Build devices for the given vehicle, if needed.
bool notifyEnter(SUMOTrafficObject &veh, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Adds passengers on vehicle insertion.
MSDevice_Transportable(SUMOVehicle &holder, const std::string &id, const bool isContainer)
Constructor.
std::vector< MSTransportable * > myTransportables
The passengers of the vehicle.
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 meanLengthOnLane)
Internal notification about the vehicle moves, see MSMoveReminder::notifyMoveInternal()
void addTransportable(MSTransportable *transportable)
Add a passenger.
const bool myAmContainer
Whether it is a container device.
const std::string deviceName() const
return the name for this type of device
void loadState(const SUMOSAXAttributes &attrs)
Loads the state of the device from the given description.
void removeTransportable(MSTransportable *transportable)
Remove a passenger (TraCI)
double getVehicleMaxSpeed(const SUMOTrafficObject *const veh) const
Returns the maximum speed the vehicle may use on this edge.
Representation of a lane in the micro simulation.
Notification
Definition of a vehicle state.
@ NOTIFICATION_ARRIVED
The vehicle arrived at its destination (is deleted)
@ NOTIFICATION_DEPARTED
The vehicle has departed (was inserted into the network)
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
virtual MSTransportableControl & getContainerControl()
Returns the container control.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
virtual MSTransportableControl & getPersonControl()
Returns the person control.
bool canLeaveVehicle(const MSTransportable *t, const SUMOVehicle &veh, const MSStop &stop)
checks whether the person may exit at the current vehicle position
void setVehicle(SUMOVehicle *v)
MSStoppingPlace * getDestinationStop() const
returns the destination stop (if any)
SUMOTime timeToBoardNextPerson
The time at which the vehicle is able to board another person.
SUMOTime duration
The stopping duration.
const SUMOVehicleParameter::Stop pars
The stop parameter.
void loadedContainers(const SUMOVehicle *veh, int n)
void unloadedPersons(const SUMOVehicle *veh, int n)
static MSStopOut * getInstance()
void unloadedContainers(const SUMOVehicle *veh, int n)
void loadedPersons(const SUMOVehicle *veh, int n)
bool addTransportable(const MSTransportable *p)
adds a transportable to this stop
virtual void erase(MSTransportable *transportable)
removes a single transportable
const MSEdge * getDestination() const
Returns the current destination.
MSStage * getCurrentStage() const
Return the current stage.
virtual bool proceed(MSNet *net, SUMOTime time, const bool vehicleArrived=false)
Abstract in-vehicle device.
SUMOVehicle & myHolder
The vehicle that stores the device.
SUMOTime getLoadingDuration(const bool isPerson) const
Get this vehicle type's loading duration.
const std::string & getID() const
Returns the id.
Static storage of an output device and its base (abstract) implementation.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
Encapsulated SAX-Attributes.
virtual std::string getString(int id, bool *isPresent=nullptr) const =0
Returns the string-value of the named (by its enum-value) attribute.
Representation of a vehicle, person, or container.
virtual const MSVehicleType & getVehicleType() const =0
Returns the object's "vehicle" type.
virtual bool isStopped() const =0
Returns whether the object is at a stop.
virtual const MSEdge * getEdge() const =0
Returns the edge the object is currently at.
Representation of a vehicle.
virtual MSVehicleDevice * getDevice(const std::type_info &type) const =0
Returns a device of the given type if it exists or 0.
virtual MSStop & getNextStop()=0
SUMOTime started
the time at which this stop was reached
SUMOTime duration
The stopping duration.