 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
46 into.push_back(device);
55 :
MSVehicleDevice(holder, id), myAmContainer(isContainer), myTransportables(), myStopped(holder.isStopped()) {
82 notifyMove(const_cast<SUMOTrafficObject&>(veh), -1, -1, -1);
109 SUMOVehicle* vehicle = dynamic_cast<SUMOVehicle*>(&veh);
146 "' from vehicle destination edge '" + veh.
getEdge()->
getID() +
194 if (key ==
"IDList") {
195 std::vector<std::string> ids;
197 ids.push_back((*i)->getID());
Representation of a vehicle or person.
std::vector< MSTransportable * > myTransportables
The passengers of the vehicle.
void unloadedContainers(const SUMOVehicle *veh, int n)
const MSEdge * getDestination() const
Returns the current destination.
#define WRITE_WARNING(msg)
Representation of a lane in the micro simulation.
virtual const MSEdge * getEdge() const =0
Returns the edge the vehicle is currently at.
static MSStopOut * getInstance()
virtual MSTransportableControl & getContainerControl()
Returns the container control.
virtual const std::string & getID() const =0
Get the vehicle's ID.
virtual void erase(MSTransportable *transportable)
removes a single transportable
Representation of a vehicle.
void loadedPersons(const SUMOVehicle *veh, int n)
virtual bool proceed(MSNet *net, SUMOTime time)=0
void loadedContainers(const SUMOVehicle *veh, int n)
SUMOVehicle & myHolder
The vehicle that stores the device.
bool myAmContainer
Whether it is a container device.
bool myStopped
Whether the vehicle is at a stop.
MSDevice_Transportable(SUMOVehicle &holder, const std::string &id, const bool isContainer)
Constructor.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
const std::string deviceName() const
return the name for this type of device
std::string getParameter(const std::string &key) const
try to retrieve the given parameter from this device. Throw exception for unsupported key
static MSDevice_Transportable * buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into, const bool isContainer)
Build devices for the given vehicle, if needed.
The vehicle has departed (was inserted into the network)
bool notifyMove(SUMOTrafficObject &veh, double oldPos, double newPos, double newSpeed)
Checks whether the vehicle is at a stop and transportable action is needed.
void removeTransportable(MSTransportable *transportable)
Remove a passenger (TraCI)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
~MSDevice_Transportable()
Destructor.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
virtual MSTransportableControl & getPersonControl()
Returns the person control.
void addTransportable(MSTransportable *transportable)
Add a passenger.
The vehicle arrived at its destination (is deleted)
bool notifyLeave(SUMOTrafficObject &veh, double lastPos, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Passengers leaving on arrival.
void unloadedPersons(const SUMOVehicle *veh, int n)
const std::string & getID() const
returns the id of the transportable
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()
bool notifyEnter(SUMOTrafficObject &veh, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Adds passengers on vehicle insertion.
const std::string & getID() const
Returns the id.
Notification
Definition of a vehicle state.
virtual bool isStopped() const =0
Returns whether the vehicle is at a stop.
Abstract in-vehicle device.