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