40 const std::string& name,
41 double chargingPower,
double efficency,
bool chargeInTransit,
double chargeDelay) :
42 MSStoppingPlace(chargingStationID, std::vector<std::string>(), lane, startPos, endPos, name),
45 myChargeInTransit(chargeInTransit),
47 myChargingVehicle(false),
49 if (chargingPower < 0)
55 if (efficency < 0 || efficency > 1) {
61 if (chargeDelay < 0) {
103 if (chargingPower < 0) {
113 if (efficency < 0 || efficency > 1) {
129 if (chargeDelay < 0) {
161 std::string status =
"";
164 status =
"chargingStopped";
166 status =
"chargingInTransit";
168 status =
"noCharging";
172 status =
"waitingChargeInTransit";
174 status =
"waitingChargeStopped";
176 status =
"noWaitingCharge";
198 std::vector<double>
charge;
199 std::vector<std::pair<SUMOTime, SUMOTime> > vectorBeginEndCharge;
203 vectorBeginEndCharge.push_back(std::pair<SUMOTime, SUMOTime>(firsTimeStep, 0));
209 vectorBeginEndCharge.back().second = i->timeStep;
211 firsTimeStep += 1000;
213 if (((i + 1) !=
myChargeValues.end()) && (((i + 1)->timeStep) != firsTimeStep)) {
215 firsTimeStep = (i + 1)->timeStep;
217 vectorBeginEndCharge.push_back(std::pair<SUMOTime, SUMOTime>(firsTimeStep, 0));
222 int vehicleCounter = 0;
248 firsTimeStep += 1000;
250 if (((i + 1) !=
myChargeValues.end()) && (((i + 1)->timeStep) != firsTimeStep)) {
252 firsTimeStep = (i + 1)->timeStep;
#define WRITE_WARNING(msg)
std::string time2string(SUMOTime t)
convert SUMOTime to string
@ SUMO_TAG_CHARGING_STATION
A Charging Station.
@ SUMO_TAG_STEP
trigger: a step description
@ SUMO_TAG_VEHICLE
description of a vehicle
@ SUMO_ATTR_PARTIALCHARGE
energy provied by charging station at certain timestep
@ SUMO_ATTR_TOTALENERGYCHARGED
@ SUMO_ATTR_MAXIMUMBATTERYCAPACITY
Maxium battery capacity.
@ SUMO_ATTR_TOTALENERGYCHARGED_VEHICLE
total energy charged into a single vehicle
@ SUMO_ATTR_ACTUALBATTERYCAPACITY
@ SUMO_ATTR_ENERGYCHARGED
tgotal of Energy charged
@ SUMO_ATTR_CHARGINGPOWER
@ SUMO_ATTR_CHARGINGSTEPS
number of steps that a vehicle is charging
@ SUMO_ATTR_CHARGINGEND
timesteps in which charging ends
@ SUMO_ATTR_EFFICIENCY
Eficiency of the charge in Charging Stations.
@ SUMO_ATTR_CHARGINGBEGIN
timestep in which charging begins
@ SUMO_ATTR_CHARGEDELAY
Delay in the charge of charging stations.
@ SUMO_ATTR_TIME
trigger: the time of the step
@ SUMO_ATTR_CHARGING_STATUS
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
double myChargingPower
Charging station's charging power.
void writeChargingStationOutput(OutputDevice &output)
write charging station values
double myTotalCharge
total energy charged by this charging station
double getChargingPower() const
Get charging station's charging power.
bool getChargeInTransit() const
Get chargeInTransit.
void setChargingVehicle(bool value)
enable or disable charging vehicle
void setEfficency(double efficency)
Set efficiency of the charging station.
double getChargeDelay() const
Get Charge Delay.
double myEfficiency
Efficiency of the charging station.
void setChargingPower(double chargingPower)
Set charging station's charging power.
void setChargeDelay(double chargeDelay)
Set charge delay of the charging station.
double myChargeDelay
Charge Delay.
bool myChargeInTransit
Allow charge in transit.
std::vector< charge > myChargeValues
vector with the charges of this charging station
bool vehicleIsInside(const double position) const
Check if a vehicle is inside in the Charge Station.
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 addChargeValueForOutput(double WCharged, MSDevice_Battery *battery)
add charge value for output
double getEfficency() const
Get efficiency of the charging station.
~MSChargingStation()
destructor
bool myChargingVehicle
Check if in the current TimeStep chargingStation is charging a vehicle.
bool isCharging() const
Return true if in the current time step charging station is charging a vehicle.
void setChargeInTransit(bool chargeInTransit)
Set charge in transit of the charging station.
Battery device for electric vehicles.
double getActualBatteryCapacity() const
Get the actual vehicle's Battery Capacity in kWh.
double getChargingStartTime() const
Get charging start time.
double getMaximumBatteryCapacity() const
Get the total vehicle's Battery Capacity in kWh.
double getStoppingTreshold() const
Get stopping treshold.
Representation of a lane in the micro simulation.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
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.
SUMOVehicle & getHolder() const
Returns the vehicle that holds this device.
const std::string & getID() const
Returns the name of the vehicle type.
std::string myID
The name of the object.
const std::string & getID() const
Returns the id.
Static storage of an output device and its base (abstract) implementation.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
virtual double getSpeed() const =0
Returns the object's current speed.
virtual const MSVehicleType & getVehicleType() const =0
Returns the object's "vehicle" type.
struct to save information for the cahrgingStation output