62 oc.
addDescription(
"device.stationfinder.rescueTime",
"Battery",
TL(
"Time to wait for a rescue vehicle on the road side when the battery is empty"));
64 oc.
addDescription(
"device.stationfinder.rescueAction",
"Battery",
TL(
"How to deal with a vehicle which has to stop due to low battery: [none, remove, tow]"));
66 oc.
addDescription(
"device.stationfinder.reserveFactor",
"Battery",
TL(
"Scale battery need with this factor to account for unexpected traffic situations"));
68 oc.
addDescription(
"device.stationfinder.emptyThreshold",
"Battery",
TL(
"Battery percentage to go into rescue mode"));
70 oc.
addDescription(
"device.stationfinder.radius",
"Battery",
TL(
"Search radius in travel time seconds"));
72 oc.
addDescription(
"device.stationfinder.maxEuclideanDistance",
"Battery",
TL(
"Euclidean search distance in meters (a negative value disables the restriction)"));
74 oc.
addDescription(
"device.stationfinder.repeat",
"Battery",
TL(
"When to trigger a new search if no station has been found"));
76 oc.
addDescription(
"device.stationfinder.maxChargePower",
"Battery",
TL(
"The maximum charging speed of the vehicle battery"));
78 oc.
addDescription(
"device.stationfinder.chargeType",
"Battery",
TL(
"Type of energy transfer"));
80 oc.
addDescription(
"device.stationfinder.waitForCharge",
"Battery",
TL(
"After this waiting time vehicle searches for a new station when the initial one is blocked"));
82 oc.
addDescription(
"device.stationfinder.saturatedChargeLevel",
"Battery",
TL(
"Target state of charge after which the vehicle stops charging"));
84 oc.
addDescription(
"device.stationfinder.needToChargeLevel",
"Battery",
TL(
"State of charge the vehicle begins searching for charging stations"));
86 oc.
addDescription(
"device.stationfinder.replacePlannedStop",
"Battery",
TL(
"Share of stopping time of the next independently planned stop to use for charging instead"));
88 oc.
addDescription(
"device.stationfinder.maxDistanceToReplacedStop",
"Battery",
TL(
"Maximum distance in meters from the original stop to be replaced by the charging stop"));
90 oc.
addDescription(
"device.stationfinder.chargingStrategy",
"Battery",
TL(
"Set a charging strategy to alter time and charging load from the set: [none, balanced, latest]"));
110 {
"waitingTime", 1.}, {
"chargingTime", 1.}
111}, { {
"waitingTime",
false}, {
"chargingTime",
false} }),
113myBattery(
nullptr), myChargingStation(
nullptr), myRescueCommand(
nullptr), myChargeLimitCommand(
nullptr),
114myLastChargeCheck(0), myCheckInterval(1000), myArrivalAtChargingStation(-1), myLastSearch(-1) {
116 myEvalParams[
"distanceto"] = 0.;
117 myEvalParams[
"timeto"] = 1.;
118 myEvalParams[
"timefrom"] = 1.;
119 myNormParams[
"chargingTime"] =
true;
120 myNormParams[
"waitingTime"] =
true;
121 myRescueTime =
STEPS2TIME(holder.getTimeParam(
"device.stationfinder.rescueTime"));
122 const std::string chargingStrategy = holder.getStringParam(
"device.stationfinder.chargingStrategy");
123 if (chargingStrategy ==
"balanced") {
124 myChargingStrategy = CHARGINGSTRATEGY_BALANCED;
125 }
else if (chargingStrategy ==
"latest") {
126 myChargingStrategy = CHARGINGSTRATEGY_LATEST;
127 }
else if (chargingStrategy ==
"none") {
128 myChargingStrategy = CHARGINGSTRATEGY_NONE;
130 WRITE_ERRORF(
TL(
"Invalid device.stationfinder.chargingStrategy '%'."), chargingStrategy);
132 const std::string rescueAction = holder.getStringParam(
"device.stationfinder.rescueAction");
133 if (rescueAction ==
"remove") {
134 myRescueAction = RESCUEACTION_REMOVE;
135 }
else if (rescueAction ==
"tow") {
136 myRescueAction = RESCUEACTION_TOW;
137 }
else if (rescueAction ==
"none") {
138 myRescueAction = RESCUEACTION_NONE;
140 WRITE_ERRORF(
TL(
"Invalid device.stationfinder.rescueAction '%'."), rescueAction);
143 myReserveFactor =
MAX2(1., holder.getFloatParam(
"device.stationfinder.reserveFactor"));
144 myEmptySoC =
MAX2(0.,
MIN2(holder.getFloatParam(
"device.stationfinder.emptyThreshold"), 1.));
145 myRadius = holder.getTimeParam(
"device.stationfinder.radius");
146 myMaxEuclideanDistance = holder.getFloatParam(
"device.stationfinder.maxEuclideanDistance");
147 myRepeatInterval = holder.getTimeParam(
"device.stationfinder.repeat");
148 myMaxChargePower = holder.getFloatParam(
"device.stationfinder.maxChargePower");
149 myChargeType = CHARGETYPE_CHARGING;
151 myWaitForCharge = holder.getTimeParam(
"device.stationfinder.waitForCharge");
152 myTargetSoC =
MAX2(0.,
MIN2(holder.getFloatParam(
"device.stationfinder.saturatedChargeLevel"), 1.));
153 mySearchSoC =
MAX2(0.,
MIN2(holder.getFloatParam(
"device.stationfinder.needToChargeLevel"), 1.));
154 if (mySearchSoC <= myEmptySoC) {
155 WRITE_WARNINGF(
TL(
"Vehicle '%' searches for charging stations only in the rescue case due to search threshold % <= rescue threshold %."), myHolder.getID(), mySearchSoC, myEmptySoC);
157 myReplacePlannedStop =
MAX2(0., holder.getFloatParam(
"device.stationfinder.replacePlannedStop"));
158 myDistanceToOriginalStop = holder.getFloatParam(
"device.stationfinder.maxDistanceToReplacedStop");
218 if (stopPos.first !=
nullptr) {
220 double endPos = stopPos.second;
221 if (stopLane != stopPos.first) {
231 rescueStop.
index = 0;
235 rescueStop.
endPos = endPos;
243 std::string errorMsg =
"Could not insert the rescue stop.";
244 if (!
myVeh.
insertStop(0, rescueStop,
"stationfinder:rescue",
false, errorMsg)) {
255 std::string errorMsg =
"Could not insert the rescue stop.";
256 if (!
myVeh.
insertStop(0, rescueStop,
"stationfinder:rescue",
false, errorMsg)) {
289 std::vector<std::string> internals;
304 internals.push_back(
toString(chargeLimit.first));
305 internals.push_back(
toString(chargeLimit.second));
330 if (csID !=
"NULL") {
333 int chargeLimitCount = 0;
334 bis >> chargeLimitCount;
335 for (
int i = 0; i < chargeLimitCount; ++i) {
362 std::vector<StoppingPlaceVisible> candidates;
364 if (chargingMemory ==
nullptr) {
388 candidates.push_back({cs,
false});
391 scores[
"expectedConsumption"] = expectedConsumption;
392 std::vector<double> probs(candidates.size(), 1.);
432 if (timeToOriginalStop +
myLastSearch < originalUntil) {
450 std::string errorMsg;
451#ifdef DEBUG_STATIONFINDER_REROUTE
452 std::ostringstream os;
454 for (
auto edge : edgesBefore) {
455 os << edge->getID() <<
" ";
457 std::cout <<
"MSDevice_StationFinder::rerouteToChargingStation: \n\tRoute before scheduling the charging station: " << os.str() <<
"\n";
459 if ((replace && !
myVeh.
replaceStop(0, stopPar,
"stationfinder:search",
false, errorMsg)) || (!replace && !
myVeh.
insertStop(0, stopPar,
"stationfinder:search",
false, errorMsg))) {
464#ifdef DEBUG_STATIONFINDER_REROUTE
465 std::ostringstream os2;
467 for (
auto edge : edgesAfter) {
468 os2 << edge->getID() <<
" ";
470 std::cout <<
"\tRoute after scheduling the charging station: " << os2.str() <<
"\n";
474#ifdef DEBUG_STATIONFINDER_REROUTE
475 std::cout <<
"\tVehicle " <<
myHolder.
getID() <<
" gets rerouted to charging station " << cs->
getID() <<
" on edge " << stopPar.
edge <<
" at time " <<
SIMTIME <<
"\n";
495#ifdef DEBUG_STATIONFINDER_RESCUE
496 std::cout <<
"MSDevice_StationFinder::teleportToChargingStation: No charging station available to teleport the broken-down vehicle " <<
myHolder.
getID() <<
" to at time " <<
SIMTIME <<
".\n.";
508#ifdef DEBUG_STATIONFINDER_RESCUE
510#ifdef DEBUG_STATIONFINDER_RESCUE
511 std::cout <<
"MSDevice_StationFinder::teleportToChargingStation: Rescue stop of " <<
myHolder.
getID() <<
" ended prematurely before regular end at " <<
SIMTIME <<
".\n.";
531 std::string errorMsg;
532 if (!
myVeh.
insertStop(1, stopPar,
"stationfinder:search",
true, errorMsg)) {
546 ConstMSEdgeVector::const_iterator targetIt = (target ==
nullptr) ? route.end() : std::find(route.begin(), route.end(), target) + 1;
551 double expectedConsumption = 0.;
554 expectedConsumption = totalConsumption / (passedTime - stopDiscount) * remainingTime;
560 speed * 0.8, 0., 0., params) * (remainingTime - passedTime);
562 if (includeEmptySoC) {
566 return expectedConsumption;
582 for (
auto stop : stops) {
583 if (stop.chargingStation !=
nullptr) {
621 if (chargeLimit < 0) {
642 const double balancedCharge = plannedCharge /
STEPS2TIME(end - begin);
647 if (end - expectedDuration > begin) {
662 tripinfoOut->
openTag(
"stationfinder");
671 if (key ==
"chargingStation") {
673 }
else if (key ==
"batteryNeed") {
675 }
else if (key ==
"needToChargeLevel") {
677 }
else if (key ==
"saturatedChargeLevel") {
679 }
else if (key ==
"waitForCharge") {
681 }
else if (key ==
"repeat") {
683 }
else if (key ==
"radius") {
685 }
else if (key ==
"reserveFactor") {
700 if (key ==
"needToChargeLevel") {
702 }
else if (key ==
"saturatedChargeLevel") {
704 }
else if (key ==
"waitForCharge") {
706 }
else if (key ==
"repeat") {
708 }
else if (key ==
"radius") {
710 }
else if (key ==
"reserveFactor") {
#define DEFAULT_CONSUMPTION_ESTIMATE_HISTORY
#define DEFAULT_SOC_INTERVAL
#define DEFAULT_AVG_WAITING_TIME
#define DEFAULT_CHARGINGSTATION_VIEW_DIST
std::vector< const MSEdge * > ConstMSEdgeVector
std::vector< MSEdge * > MSEdgeVector
#define WRITE_WARNINGF(...)
#define WRITE_MESSAGEF(...)
#define WRITE_ERRORF(...)
#define WRITE_MESSAGE(msg)
const int STOP_DURATION_SET
@ SUMO_TAG_CHARGING_STATION
A Charging Station.
@ SUMO_ATTR_PROPULSIONEFFICIENCY
Propulsion efficiency.
@ SUMO_ATTR_STATE
The state of a link.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
An upper class for objects with additional parameters.
double getDouble(SumoXMLAttr attr) const
bool replaceStop(int nextStopIndex, SUMOVehicleParameter::Stop stop, const std::string &info, bool teleport, std::string &errorMsg)
const std::list< MSStop > & getStops() const
bool hasStops() const
Returns whether the vehicle has to stop somewhere.
MSStop & getStop(int nextStopIndex)
bool insertStop(int nextStopIndex, SUMOVehicleParameter::Stop stop, const std::string &info, bool teleport, std::string &errorMsg)
const MSRoute & getRoute() const
Returns the current route.
const StoppingPlaceMemory * getChargingMemory() const
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
bool abortNextStop(int nextStopIndex=0)
deletes the next stop at the given index if it exists
double brakeGap(const double speed) const
Returns the distance the vehicle needs to halt including driver's reaction time tau (i....
double getChargingPower(bool usingFuel) const
Get charging station's charging power.
SUMOTime getChargeDelay() const
Get Charge Delay.
double getEfficency() const
Get efficiency of the charging station.
const MSParkingArea * getParkingArea() const
Get the parking area the charging station is placed on.
double getActualBatteryCapacity() const
Get the actual vehicle's Battery Capacity in Wh.
void setChargeLimit(const double limit)
Set (temporary) charge limit.
double getMaximumBatteryCapacity() const
Get the total vehicle's Battery Capacity in Wh.
SUMOTime estimateChargingDuration(const double toCharge, const double csPower) const
Estimate the charging duration given the current battery state.
double getTotalConsumption() const
Get total consumption.
double getEnergyCharged() const
Get charged energy.
std::string getChargingStationID() const
Get current Charging Station ID.
A device which triggers rerouting to nearby charging stations.
double myUpdateSoC
SoC the last time the station finder algorithm was run completely.
void resetStoppingPlaceScores(SUMOVehicle &veh) override
forget all stopping place score for this 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) override
Internal notification about the vehicle moves, see MSMoveReminder::notifyMoveInternal()
void rememberBlockedStoppingPlace(SUMOVehicle &veh, const MSStoppingPlace *stoppingPlace, bool blocked) override
store the blocked stopping place in the vehicle
WrappingCommand< MSDevice_StationFinder > * myRescueCommand
The command responsible for rescue actions.
void implementChargingStrategy(SUMOTime begin, SUMOTime end, const double plannedCharge, const MSChargingStation *cs)
MSDevice_StationFinder(SUMOVehicle &holder)
Constructor.
ChargingStrategy myChargingStrategy
The chosen charging strategy.
SUMOTime teleportToChargingStation(const SUMOTime currentTime)
search for a charging station and teleport the vehicle there as a rescue measure
double myDistanceToOriginalStop
The distance in meters to the original stop replaced by the charging stop (models charging close to t...
void loadState(const SUMOSAXAttributes &attrs)
Loads the state of the device from the given description.
MSVehicle & myVeh
myHolder cast to needed type
double getStoppingPlaceOccupancy(MSStoppingPlace *stoppingPlace) override
Return the number of occupied places of the StoppingPlace.
MSStoppingPlace * myChargingStation
To which station we are currently travelling.
WrappingCommand< MSDevice_StationFinder > * myChargeLimitCommand
The command responsible for limiting the charging rate (~ implement charging strategies)
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_StationFinder-options.
int getNumberStoppingPlaceReroutes(SUMOVehicle &veh) override
ask how many times already the vehicle has been rerouted to another stopping place
~MSDevice_StationFinder()
Destructor.
double myTargetSoC
The target state of charge where the vehicle stops charging.
const std::string deviceName() const override
return the name for this type of device
std::string getParameter(const std::string &key) const override
try to retrieve the given parameter from this device. Throw exception for unsupported key
bool rerouteToChargingStation(bool replace=false)
reroute to a charging station
double myRescueTime
The time to wait for a rescue vehicle in case the battery is empty.
void saveState(OutputDevice &out) const
Saves the state of the device.
SUMOTime myLastChargeCheck
Last time the SoC was checked.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
void initRescueCommand()
create the event command for teleporting in case of brake-down
void setParameter(const std::string &key, const std::string &value)
try to set the given parameter for this device. Throw exception for unsupported key
bool useStoppingPlace(MSStoppingPlace *stoppingPlace) override
Whether the stopping place should be included in the search (can be used to add an additional filter)
double getLastStepStoppingPlaceOccupancy(MSStoppingPlace *stoppingPlace) override
Return the number of occupied places of the StoppingPlace from the previous time step.
double getStoppingPlaceCapacity(MSStoppingPlace *stoppingPlace) override
Return the number of places the StoppingPlace provides.
void rememberStoppingPlaceScore(SUMOVehicle &veh, MSStoppingPlace *place, const std::string &score) override
store the stopping place score in the vehicle
@ CHARGINGSTRATEGY_BALANCED
SUMOTime myWaitForCharge
Accepted waiting time at the charging station before a place becomes available.
SUMOTime myLastSearch
Last time charging stations have been searched.
@ SEARCHSTATE_BROKEN_DOWN
@ SEARCHSTATE_UNSUCCESSFUL
void setNumberStoppingPlaceReroutes(SUMOVehicle &veh, int value) override
update the number of reroutes for the vehicle
SUMOTime sawBlockedStoppingPlace(SUMOVehicle &veh, MSStoppingPlace *place, bool local) override
ask the vehicle when it has seen the stopping place
double mySearchSoC
The state of charge at which the vehicle starts looking for charging stations.
SUMOTime myArrivalAtChargingStation
Arrival time in the vicinity of the target charging station (to track the waiting time before accessi...
double myEmptySoC
The state of charge threshold below which rescue mode is activated.
double myMaxEuclideanDistance
The maximum euclidean distance between the vehicle and the charging station (-1 deactivates the condi...
bool validComponentValues(StoppingPlaceParamMap_t &stoppingPlaceValues) override
Whether the stopping place should be discarded due to its results from the component evaluation.
bool notifyIdle(SUMOTrafficObject &veh) override
Computes idling emission values and adds them to the emission sums.
void generateOutput(OutputDevice *tripinfoOut) const override
Called on writing tripinfo output.
SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouter(SUMOVehicle &veh, const MSEdgeVector &prohibited) override
Provide the router to use (MSNet::getRouterTT or MSRoutingEngine)
MSDevice_Battery * myBattery
The corresponding battery device.
MSChargingStation * findChargingStation(SUMOAbstractRouter< MSEdge, SUMOVehicle > &router, double expectedConsumption, StoppingPlaceParamMap_t &scores, bool constrainTT=true, bool skipVisited=true, bool skipOccupied=false)
central search function for close charging stations
bool alreadyPlannedCharging()
adopt a planned charging stop outside of the device
double freeSpaceAtChargingStation(MSChargingStation *cs) const
compute the free space at a charging station
std::vector< std::pair< SUMOTime, double > > myChargeLimits
The next charging rates to set via myChargingRateCommand.
SUMOTime myRadius
The max travel time to the next charging station.
SearchState mySearchState
The current state of the charging search (remember for decision logic)
SUMOTime myRepeatInterval
Time interval to search again for a charging station if the first attempt failed.
bool evaluateCustomComponents(SUMOVehicle &veh, double brakeGap, bool newDestination, MSStoppingPlace *alternative, double occupancy, double prob, SUMOAbstractRouter< MSEdge, SUMOVehicle > &router, StoppingPlaceParamMap_t &stoppingPlaceValues, ConstMSEdgeVector &newRoute, ConstMSEdgeVector &stoppingPlaceApproach, StoppingPlaceParamMap_t &maxValues, StoppingPlaceParamMap_t &addInput) override
Compute some custom target function components.
SUMOTime updateChargeLimit(const SUMOTime currentTime)
update the maximum charge rate of the battery to simulate charging strategies
double myReplacePlannedStop
The share of stopping time a charging stop should take from the next regulr (non-charging) stop under...
RescueAction myRescueAction
What to do when the state of charge gets very low.
bool notifyMove(SUMOTrafficObject &veh, double oldPos, double newPos, double newSpeed) override
Computes current emission values and adds them to their sums.
double myReserveFactor
The safety buffer when calculating expected consumption.
void initChargeLimitCommand()
create the event command for changing charging rates
double estimateConsumption(const MSEdge *target=nullptr, const bool includeEmptySoC=true, const double stopDiscount=0.) const
estimate the energy needed for the planned route / up to a target edge
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.
virtual void addEvent(Command *operation, SUMOTime execTimeStep=-1)
Adds an Event.
Representation of a lane in the micro simulation.
const MSLane * getNormalSuccessorLane() const
get normal lane following this internal lane, for normal lanes, the lane itself is returned
double getSpeedLimit() const
Returns the lane's maximum allowed speed.
double getLength() const
Returns the lane's length.
MSEdge & getEdge() const
Returns the lane's edge.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
MSEventControl * getBeginOfTimestepEvents()
Returns the event control for events executed at the begin of a time step.
MSStoppingPlace * getStoppingPlace(const std::string &id, const SumoXMLTag category) const
Returns the named stopping place of the given category.
const NamedObjectCont< MSStoppingPlace * > & getStoppingPlaces(SumoXMLTag category) const
int getCapacity() const
Returns the area capacity.
bool parkOnRoad() const
whether vehicles park on the road
bool accepts(MSBaseVehicle *veh) const
Return the parking accepts the vehicle (due to its given badges)
int getLastStepOccupancy() const
Returns the area occupancy at the end of the last simulation step.
int getOccupancy() const
Returns the area occupancy.
const ConstMSEdgeVector & getEdges() const
static MSVehicleRouter & getRouterTT(const int rngIndex, SUMOVehicleClass svc, const MSEdgeVector &prohibited=MSEdgeVector())
return the vehicle router instance
MSStoppingPlace * chargingStation
(Optional) charging station if one is assigned to the stop
SUMOTime duration
The stopping duration.
const SUMOVehicleParameter::Stop pars
The stop parameter.
A lane area vehicles can halt at.
double getBeginLanePosition() const
Returns the begin position of this stop.
double getEndLanePosition() const
Returns the end position of this stop.
const MSLane & getLane() const
Returns the lane this stop is located at.
double getLastFreePos(const SUMOVehicle &forVehicle, double brakePos=0) const
Returns the last free position on this stop.
MSStoppingPlace * reroute(std::vector< StoppingPlaceVisible > &stoppingPlaceCandidates, const std::vector< double > &probs, SUMOVehicle &veh, bool &newDestination, ConstMSEdgeVector &newRoute, StoppingPlaceParamMap_t &scores, const MSEdgeVector &closedEdges={})
main method to trigger the rerouting to the "best" StoppingPlace according to the custom evaluation f...
std::map< std::string, double > StoppingPlaceParamMap_t
double getWeight(SUMOVehicle &veh, const std::string param, const double defaultWeight, const bool warn=false)
read the value of a stopping place search param, e.g. a component weight factor
Abstract in-vehicle device.
SUMOVehicle & myHolder
The vehicle that stores the device.
Representation of a vehicle in the micro simulation.
bool willStop() const
Returns whether the vehicle will stop on the current edge.
double getDistanceToPosition(double destPos, const MSLane *destLane) const
const MSLane * getLane() const
Returns the lane the vehicle is on.
std::pair< const MSLane *, double > getLanePosAfterDist(double distance) const
return lane and position along bestlanes at the given distance
double getSpeed() const
Returns the vehicle's current speed.
const MSCFModel & getCarFollowModel() const
Returns the vehicle's car following model definition.
double getMinGap() const
Get the free space in front of vehicles of this class.
SUMOEmissionClass getEmissionClass() const
Get this vehicle type's emission class.
double getLength() const
Get vehicle's length [m].
const SUMOVTypeParameter & getParameter() const
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.
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.
static double compute(const SUMOEmissionClass c, const EmissionType e, const double v, const double a, const double slope, const EnergyParams *param)
Returns the amount of the emitted pollutant given the vehicle type and state (in mg/s or ml/s for fue...
virtual double recomputeCosts(const std::vector< const E * > &edges, const V *const v, SUMOTime msTime, double *lengthp=nullptr) const
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 const MSLane * getLane() const =0
Returns the lane the object is currently at.
virtual int getRNGIndex() const =0
virtual double getMaxSpeed() const =0
Returns the object's maximum speed (minimum of technical and desired maximum speed)
virtual SUMOVehicleClass getVClass() const =0
Returns the object's access class.
virtual Position getPosition(const double offset=0) const =0
Return current position (x/y, cartesian)
virtual int getRoutePosition() const =0
return index of edge within route
double length
The physical vehicle length.
Representation of a vehicle.
virtual bool isStopped() const =0
Returns whether the vehicle is at a stop and waiting for a person or container to continue.
virtual bool hasStops() const =0
Returns whether the vehicle has to stop somewhere.
virtual const std::list< MSStop > & getStops() const =0
virtual SUMOTime sawBlockedChargingStation(const MSStoppingPlace *cs, bool local) const =0
virtual SUMOTime getDeparture() const =0
Returns this vehicle's real departure time.
virtual double getLength() const =0
Returns the vehicles's length.
virtual void rememberBlockedChargingStation(const MSStoppingPlace *cs, bool local)=0
virtual void resetChargingStationScores()=0
virtual EnergyParams * getEmissionParameters() const =0
Returns the vehicle's emission model parameter.
virtual void rememberChargingStationScore(const MSStoppingPlace *cs, const std::string &score)=0
virtual MSStop & getNextStop()=0
virtual const SUMOVehicleParameter::Stop * getNextStopParameter() const =0
Returns parameters of the next stop or nullptr.
virtual const MSRoute & getRoute() const =0
Returns the current route.
virtual bool abortNextStop(int nextStopIndex=0)=0
deletes the next stop at the given index if it exists
Definition of vehicle stop (position and duration)
std::string edge
The edge to stop at.
ParkingType parking
whether the vehicle is removed from the net while stopping
std::string lane
The lane to stop at.
std::string parkingarea
(Optional) parking area if one is assigned to the stop
double startPos
The stopping position start.
bool breakDown
Whether this stop was triggered by a car failure / mechanical problem / lack of energy.
std::string chargingStation
(Optional) charging station if one is assigned to the stop
int parametersSet
Information for the output which parameter were set.
int index
at which position in the stops list
SUMOTime jump
transfer time if there shall be a jump from this stop to the next route edge
SUMOTime until
The time at which the vehicle may continue its journey.
double endPos
The stopping position end.
SUMOTime duration
The stopping duration.
SUMOTime sawBlockedStoppingPlace(const MSStoppingPlace *stoppingPlace, bool local) const
Get the time the StoppingPlace was confirmed to be blocked.
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
A wrapper for a Command function.
void deschedule()
Marks this Command as being descheduled.