46 oc.
addDescription(
"device.stationfinder.rescueTime",
"Battery",
TL(
"Time to wait for a rescue vehicle on the road side when the battery is empty"));
48 oc.
addDescription(
"device.stationfinder.reserveFactor",
"Battery",
TL(
"Additional battery buffer for unexpected traffic situation when estimating the battery need"));
50 oc.
addDescription(
"device.stationfinder.emptyThreshold",
"Battery",
TL(
"Battery percentage to go into rescue mode"));
52 oc.
addDescription(
"device.stationfinder.radius",
"Battery",
TL(
"Search radius in travel time seconds"));
54 oc.
addDescription(
"device.stationfinder.repeat",
"Battery",
TL(
"When to trigger a new search if no station has been found"));
56 oc.
addDescription(
"device.stationfinder.maxChargePower",
"Battery",
TL(
"The maximum charging speed of the vehicle battery"));
58 oc.
addDescription(
"device.stationfinder.chargeType",
"Battery",
TL(
"Type of energy transfer"));
60 oc.
addDescription(
"device.stationfinder.waitForCharge",
"Battery",
TL(
"After this waiting time vehicle searches for a new station when the initial one is blocked"));
78 myBattery(nullptr), myChargingStation(nullptr) {
100 double minTime = std::numeric_limits<double>::max();
106 const MSEdge*
const csEdge = &stop.second->getLane().getEdge();
109 if (csEdge == route.back() || router.
compute(start, &stop.second->getLane().getEdge(), &
myHolder, now, routeFrom)) {
110 if (csEdge != route.back()) {
111 routeTo.insert(routeTo.end(), routeFrom.begin() + 1, routeFrom.end());
114 if (time < minTime) {
122 if (minStation !=
nullptr) {
133 std::string errorMsg;
136 }
else if (errorMsg !=
"") {
170 if (tripinfoOut !=
nullptr) {
std::vector< const MSEdge * > ConstMSEdgeVector
#define WRITE_WARNINGF(...)
#define WRITE_WARNING(msg)
@ SUMO_TAG_CHARGING_STATION
A Charging Station.
double getChargingPower(bool usingFuel) const
Get charging station's charging power in the.
double getActualBatteryCapacity() const
Get the actual vehicle's Battery Capacity in Wh.
double getTotalConsumption() const
Get total consumption.
A device which triggers rerouting to nearby charging stations.
void generateOutput(OutputDevice *tripinfoOut) const
Called on writing tripinfo output.
MSDevice_StationFinder(SUMOVehicle &holder)
Constructor.
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()
bool notifyMove(SUMOTrafficObject &veh, double oldPos, double newPos, double newSpeed)
Computes current emission values and adds them to their sums.
MSStoppingPlace * myChargingStation
To which station we are currently travelling.
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_StationFinder-options.
~MSDevice_StationFinder()
Destructor.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
bool notifyIdle(SUMOTrafficObject &veh)
Computes idling emission values and adds them to the emission sums.
MSDevice_Battery * myBattery
The corresponding battery device.
double myReserveFactor
The safety buffer when calculating expected consumption.
static double getFloatParam(const SUMOVehicle &v, const OptionsCont &oc, std::string paramName, double deflt, bool required=false)
static void insertDefaultAssignmentOptions(const std::string &deviceName, const std::string &optionsTopic, OptionsCont &oc, const bool isPerson=false)
Adds common command options that allow to assign devices to vehicles.
static bool equippedByDefaultAssignmentOptions(const OptionsCont &oc, const std::string &deviceName, DEVICEHOLDER &v, bool outputOptionSet, const bool isPerson=false)
Determines whether a vehicle should get a certain device.
A road/street connecting two junctions.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
const NamedObjectCont< MSStoppingPlace * > & getStoppingPlaces(SumoXMLTag category) const
const ConstMSEdgeVector & getEdges() const
static SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterTT(const int rngIndex, SUMOVehicleClass svc, const MSEdgeVector &prohibited=MSEdgeVector())
return the router instance
double getEndLanePosition() const
Returns the end position of this stop.
const MSLane & getLane() const
Returns the lane this stop is located at.
Abstract in-vehicle device.
SUMOVehicle & myHolder
The vehicle that stores the device.
const std::string & getID() const
Returns the id.
A storage for options typed value containers)
void addDescription(const std::string &name, const std::string &subtopic, const std::string &description)
Adds a description for an option.
void doRegister(const std::string &name, Option *o)
Adds an option under the given name.
static OptionsCont & getOptions()
Retrieves the options.
Static storage of an output device and its base (abstract) implementation.
virtual bool compute(const E *from, const E *to, const V *const vehicle, SUMOTime msTime, std::vector< const E * > &into, bool silent=false)=0
Builds the route between the given edges using the minimum effort at the given time The definition of...
virtual double recomputeCosts(const std::vector< const E * > &edges, const V *const v, SUMOTime msTime, double *lengthp=nullptr) const
Representation of a vehicle, person, or container.
virtual SUMOVehicleClass getVClass() const =0
Returns the object's access class.
virtual int getRoutePosition() const =0
return index of edge within route
virtual const MSEdge * getEdge() const =0
Returns the edge the object is currently at.
virtual double getPositionOnLane() const =0
Get the object's position along the lane.
Representation of a vehicle.
virtual bool replaceRouteEdges(ConstMSEdgeVector &edges, double cost, double savings, const std::string &info, bool onInit=false, bool check=false, bool removeStops=true, std::string *msgReturn=nullptr)=0
Replaces the current route by the given edges.
virtual bool hasStops() const =0
Returns whether the vehicle has to stop somewhere.
virtual bool addStop(const SUMOVehicleParameter::Stop &stopPar, std::string &errorMsg, SUMOTime untilOffset=0, ConstMSEdgeVector::const_iterator *searchStart=0)=0
Adds a stop.
virtual SUMOTime getDeparture() const =0
Returns this vehicle's real departure time.
virtual int getRNGIndex() const =0
virtual const MSRoute & getRoute() const =0
Returns the current route.
Definition of vehicle stop (position and duration)
std::string lane
The lane to stop at.
std::string chargingStation
(Optional) charging station if one is assigned to the stop
double endPos
The stopping position end.
SUMOTime duration
The stopping duration.