 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
41 const std::string& name,
42 double chargingPower,
double efficency,
bool chargeInTransit,
double chargeDelay) :
43 MSStoppingPlace(chargingStationID, std::vector<std::string>(), lane, startPos, endPos, name),
46 myChargeInTransit(chargeInTransit),
48 myChargingVehicle(false),
50 if (chargingPower < 0)
56 if (efficency < 0 || efficency > 1) {
62 if (chargeDelay < 0) {
104 if (chargingPower < 0) {
114 if (efficency < 0 || efficency > 1) {
130 if (chargeDelay < 0) {
162 std::string status =
"";
165 status =
"chargingStopped";
167 status =
"chargingInTransit";
169 status =
"noCharging";
173 status =
"waitingChargeInTransit";
175 status =
"waitingChargeStopped";
177 status =
"noWaitingCharge";
199 std::vector<double>
charge;
200 std::vector<std::pair<SUMOTime, SUMOTime> > vectorBeginEndCharge;
204 vectorBeginEndCharge.push_back(std::pair<SUMOTime, SUMOTime>(firsTimeStep, 0));
210 vectorBeginEndCharge.back().second = i->timeStep;
212 firsTimeStep += 1000;
214 if (((i + 1) !=
myChargeValues.end()) && (((i + 1)->timeStep) != firsTimeStep)) {
216 firsTimeStep = (i + 1)->timeStep;
218 vectorBeginEndCharge.push_back(std::pair<SUMOTime, SUMOTime>(firsTimeStep, 0));
223 int vehicleCounter = 0;
249 firsTimeStep += 1000;
251 if (((i + 1) !=
myChargeValues.end()) && (((i + 1)->timeStep) != firsTimeStep)) {
253 firsTimeStep = (i + 1)->timeStep;
double getChargingPower() const
Get charging station's charging power.
double getMaximumBatteryCapacity() const
Get the total vehicle's Battery Capacity in kWh.
const std::string & getID() const
Returns the name of the vehicle type.
A lane area vehicles can halt at.
#define WRITE_WARNING(msg)
Representation of a lane in the micro simulation.
double getStoppingTreshold() const
Get stopping treshold.
double getEndLanePosition() const
Returns the end position of this stop.
Static storage of an output device and its base (abstract) implementation.
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.
double getActualBatteryCapacity() const
Get the actual vehicle's Battery Capacity in kWh.
virtual const std::string & getID() const =0
Get the vehicle's ID.
double getBeginLanePosition() const
Returns the begin position of this stop.
bool myChargeInTransit
Allow charge in transit.
void setChargeDelay(double chargeDelay)
Set charge delay of the charging station.
@ SUMO_ATTR_MAXIMUMBATTERYCAPACITY
Maxium battery capacity.
std::vector< charge > myChargeValues
vector with the charges of this charging station
double myChargeDelay
Charge Delay.
~MSChargingStation()
destructor
@ SUMO_ATTR_TOTALENERGYCHARGED
struct to save information for the cahrgingStation output
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
void setChargingVehicle(bool value)
enable or disable charging vehicle
void setChargeInTransit(bool chargeInTransit)
Set charge in transit of the charging station.
double getEfficency() const
Get efficiency of the charging station.
double myTotalCharge
total energy charged by this charging station
void setEfficency(double efficency)
Set efficiency of the charging station.
@ SUMO_ATTR_CHARGEDELAY
Delay in the charge of charging stations.
@ SUMO_ATTR_CHARGINGSTEPS
number of steps that a vehicle is charging
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
@ SUMO_ATTR_CHARGINGPOWER
@ SUMO_TAG_CHARGING_STATION
A Charging Station.
@ SUMO_ATTR_CHARGINGEND
timesteps in which charging ends
void writeChargingStationOutput(OutputDevice &output)
write charging station values
double myEfficiency
Efficiency of the charging station.
@ SUMO_ATTR_ACTUALBATTERYCAPACITY
double myChargingPower
Charging station's charging power.
@ SUMO_TAG_STEP
trigger: a step description
SUMOVehicle & getHolder() const
Returns the vehicle that holds this device.
std::string time2string(SUMOTime t)
Battery device for electric vehicles.
@ SUMO_ATTR_TOTALENERGYCHARGED_VEHICLE
total energy charged into a single vehicle
@ SUMO_TAG_VEHICLE
description of a vehicle
@ SUMO_ATTR_TIME
trigger: the time of the step
bool myChargingVehicle
Check if in the current TimeStep chargingStation is charging a vehicle.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
@ SUMO_ATTR_CHARGING_STATUS
MSChargingStation(const std::string &chargingStationID, MSLane &lane, double startPos, double endPos, const std::string &name, double chargingPower, double efficency, bool chargeInTransit, double chargeDelay)
constructor
void setChargingPower(double chargingPower)
Set charging station's charging power.
bool isCharging() const
Return true if in the current time step charging station is charging a vehicle.
@ SUMO_ATTR_EFFICIENCY
Eficiency of the charge in Charging Stations.
bool vehicleIsInside(const double position) const
Check if a vehicle is inside in the Charge Station.
@ SUMO_ATTR_PARTIALCHARGE
energy provied by charging station at certain timestep
void addChargeValueForOutput(double WCharged, MSDevice_Battery *battery)
add charge value for output
@ SUMO_ATTR_ENERGYCHARGED
tgotal of Energy charged
std::string myID
The name of the object.
double getChargeDelay() const
Get Charge Delay.
double getChargingStartTime() const
Get charging start time.
const std::string & getID() const
Returns the id.
@ SUMO_ATTR_CHARGINGBEGIN
timestep in which charging begins
bool getChargeInTransit() const
Get chargeInTransit.
virtual double getSpeed() const =0
Returns the vehicle's current speed.