 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
18 #ifndef MSBaseVehicle_h
19 #define MSBaseVehicle_h
83 const std::string&
getID()
const;
101 bool hasDevice(
const std::string& deviceName)
const;
107 std::string
getDeviceParameter(
const std::string& deviceName,
const std::string& key)
const;
110 void setDeviceParameter(
const std::string& deviceName,
const std::string& key,
const std::string& value);
234 bool replaceRouteEdges(
ConstMSEdgeVector& edges,
double cost,
double savings,
const std::string& info,
bool onInit =
false,
bool check =
false,
bool removeStops =
true);
341 inline const std::vector<MSVehicleDevice*>&
getDevices()
const {
366 const std::vector<MSTransportable*>&
getPersons()
const;
476 void addStops(
const bool ignoreStopErrors);
487 std::mt19937*
getRNG()
const;
586 static void initMoveReminderOutput(
const OptionsCont& oc);
590 void traceMoveReminder(
const std::string& type,
MSMoveReminder* rem,
double pos,
bool keep)
const;
593 const bool myTraceMoveReminders;
596 static std::set<std::string> myShallTraceMoveReminders;
The car-following model and parameter.
#define UNUSED_PARAMETER(x)
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
const SUMOVehicleParameter & getParameter() const
Returns the vehicle's parameter (including departure definition)
bool hasDeparted() const
Returns whether this vehicle has already departed.
virtual double getArrivalPos() const
Returns this vehicle's desired arrivalPos for its current route (may change on reroute)
A MSVehicle extended by some values for usage within the gui.
int getContainerNumber() const
Returns the number of containers.
Representation of a lane in the micro simulation.
void setDeviceParameter(const std::string &deviceName, const std::string &key, const std::string &value)
try to set the given parameter from any of the vehicles devices, raise InvalidArgument if no device p...
virtual ~MSBaseVehicle()
Destructor.
MSBaseVehicle(SUMOVehicleParameter *pars, const MSRoute *route, MSVehicleType *type, const double speedFactor)
Constructor.
virtual bool wasRemoteControlled(SUMOTime lookBack=DELTA_T) const
Returns the information whether the vehicle is fully controlled via TraCI.
Static storage of an output device and its base (abstract) implementation.
SUMOTime myDeparture
The real departure time.
virtual double getLateralPositionOnLane() const
Get the vehicle's lateral position on the lane.
ConstMSEdgeVector::const_iterator MSRouteIterator
double myChosenSpeedFactor
A precomputed factor by which the driver wants to be faster than the speed limit.
std::vector< MSVehicleDevice * > myDevices
The devices this vehicle has.
int getNumberReroutes() const
Returns the number of new routes this vehicle got.
double getLength() const
Returns the vehicle's length.
SUMOTime getDepartDelay() const
Returns the depart delay.
SUMOTime getDeparture() const
Returns this vehicle's real departure time.
Representation of a vehicle.
const MSRoute * myRoute
This vehicle's route.
const MSRoute & getRoute() const
Returns the current route.
std::vector< const MSEdge * > ConstMSEdgeVector
bool hasValidRoute(std::string &msg, const MSRoute *route=0) const
Validates the current or given route.
void replaceParameter(const SUMOVehicleParameter *newParameter)
replace the vehicle parameter (deleting the old one)
int myArrivalLane
The destination lane where the vehicle stops.
const MSDevice_Transportable * getPersonDevice() const
int getRoutePosition() const
return index of edge within route
virtual const MSEdge * getRerouteOrigin() const
Returns the starting point for reroutes (usually the current edge)
Structure representing possible vehicle parameter.
long long int NumericalID
virtual bool isRemoteControlled() const
Returns the information whether the vehicle is fully controlled via TraCI.
void resetRoutePosition(int index, DepartLaneDefinition departLaneProcedure)
reset index of edge within route
double getMaxSpeed() const
Returns the maximum speed.
virtual bool isSelected() const
whether this vehicle is selected in the GUI
void calculateArrivalParams()
(Re-)Calculates the arrival position and lane from the vehicle parameters
Something on a lane to be noticed about vehicle movement.
double getChosenSpeedFactor() const
Returns the precomputed factor by which the driver wants to be faster than the speed limit.
virtual const ConstMSEdgeVector getStopEdges(double &firstPos, double &lastPos) const =0
Returns the list of still pending stop edges.
const SUMOVehicleParameter * myParameter
This vehicle's parameter.
double myArrivalPos
The position on the destination lane where the vehicle stops.
const MSEdge * getEdge() const
Returns the edge the vehicle is currently at.
void createDevice(const std::string &deviceName)
create device of the given type
double getOdometer() const
Returns the distance that was already driven by this vehicle.
virtual void saveState(OutputDevice &out)
Saves the (common) state of a vehicle.
double getDepartPos() const
Returns this vehicle's real departure position.
MSDevice_Transportable * myPersonDevice
The passengers this vehicle may have.
std::string getDeviceParameter(const std::string &deviceName, const std::string &key) const
try to retrieve the given parameter from any of the vehicles devices, raise InvalidArgument if no dev...
const std::vector< MSTransportable * > & getContainers() const
retrieve riding containers
const std::vector< MSVehicleDevice * > & getDevices() const
Returns this vehicle's devices.
double getImpatience() const
Returns this vehicles impatience.
double getWidth() const
Get the width which vehicles of this class shall have when being drawn.
const std::map< int, double > * getEmissionParameters() const
Returns the vehicle's emission model parameter.
void setChosenSpeedFactor(const double factor)
Returns the precomputed factor by which the driver wants to be faster than the speed limit.
virtual void addPerson(MSTransportable *person)
Adds a person to this vehicle.
double myDepartPos
The real depart position.
MSBaseVehicle & operator=(const MSBaseVehicle &s)
invalidated assignment operator
A storage for options typed value containers)
A road/street connecting two junctions.
virtual bool isOnRoad() const
Returns the information whether the vehicle is on a road (is simulated)
virtual double getAcceleration() const
Returns the vehicle's acceleration.
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
virtual bool isFrontOnLane(const MSLane *) const
Returns the information whether the front of the vehhicle is on the given lane.
bool replaceRouteEdges(ConstMSEdgeVector &edges, double cost, double savings, const std::string &info, bool onInit=false, bool check=false, bool removeStops=true)
Replaces the current route by the given edges.
virtual double getSlope() const
Returns the slope of the road at vehicle's position.
int myNumberReroutes
The number of reroutings.
DepartLaneDefinition
Possible ways to choose a lane on depart.
void addStops(const bool ignoreStopErrors)
Adds stops to the built vehicle.
const MSDevice_Transportable * getContainerDevice() const
std::vector< std::string > getPersonIDList() const
Returns the list of persons.
MSRouteIterator myCurrEdge
Iterator to current route-edge.
static std::vector< MSTransportable * > myEmptyTransportableVector
bool hasDevice(const std::string &deviceName) const
check whether the vehicle is equiped with a device of the given type
double getLength() const
Get vehicle's length [m].
const std::vector< MSTransportable * > & getPersons() const
retrieve riding persons
std::vector< std::pair< MSMoveReminder *, double > > MoveReminderCont
Definition of a move reminder container.
const MSEdge * succEdge(int nSuccs) const
Returns the nSuccs'th successor of edge the vehicle is currently at.
SUMOVehicleClass getVClass() const
Returns the vehicle's access class.
NumericalID getNumericalID() const
return the numerical ID which is only for internal usage
MSVehicleType & getSingularType()
Replaces the current vehicle type with a new one used by this vehicle only.
int getPersonNumber() const
Returns the number of persons.
const MSRouteIterator & getCurrentRouteEdge() const
Returns an iterator pointing to the current edge in this vehicles route.
const SUMOVTypeParameter & getParameter() const
The base class for microscopic and mesoscopic vehicles.
const std::string & getID() const
Returns the name of the vehicle.
virtual bool hasArrived() const
Returns whether this vehicle has already arived (by default this is true if the vehicle has reached i...
void addReminder(MSMoveReminder *rem)
Adds a MoveReminder dynamically.
virtual void setArrivalPos(double arrivalPos)
Sets this vehicle's desired arrivalPos for its current route.
double getWidth() const
Returns the vehicle's width.
void onDepart()
Called when the vehicle is inserted into the network.
double getPreviousSpeed() const
Returns the vehicle's previous speed.
static NumericalID myCurrentNumericalIndex
const NumericalID myNumericalID
void removeReminder(MSMoveReminder *rem)
Removes a MoveReminder dynamically.
void removeTransportable(MSTransportable *t)
removes a person or container
bool isVehicle() const
Get the vehicle's ID.
void reroute(SUMOTime t, const std::string &info, SUMOAbstractRouter< MSEdge, SUMOVehicle > &router, const bool onInit=false, const bool withTaz=false, const bool silent=false)
Performs a rerouting using the given router.
MSVehicleType * myType
This vehicle's type.
double myOdometer
A simple odometer to keep track of the length of the route already driven.
MSVehicleDevice * getDevice(const std::type_info &type) const
Returns a device of the given type if it exists or 0.
static const SUMOTime NOT_YET_DEPARTED
MSDevice_Transportable * myContainerDevice
The containers this vehicle may have.
MoveReminderCont myMoveReminders
Currently relevant move reminders.
virtual void activateReminders(const MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
"Activates" all current move reminder
SUMOVehicleClass vehicleClass
The vehicle's class.
Notification
Definition of a vehicle state.
void replaceVehicleType(MSVehicleType *type)
Replaces the current vehicle type by the one given.
std::mt19937 * getRNG() const
Abstract in-vehicle device.
virtual void addContainer(MSTransportable *container)
Adds a container to this vehicle.