49 double chargingPower,
double efficency,
bool chargeInTransit,
int chargeDelay) :
50 MSStoppingPlace(chargingStationID, std::vector<std::string>(), lane, startPos, endPos),
53 myChargeInTransit(chargeInTransit),
55 myChargingVehicle(false),
57 if (chargingPower < 0)
63 if (efficency < 0 || efficency > 1) {
69 if (chargeDelay < 0) {
111 if (chargingPower < 0) {
121 if (efficency < 0 || efficency > 1) {
137 if (chargeDelay < 0) {
169 std::string status =
"";
172 status =
"chargingStopped";
174 status =
"chargingInTransit";
176 status =
"noCharging";
180 status =
"waitingChargeInTransit";
182 status =
"waitingChargeStopped";
184 status =
"noWaitingCharge";
206 std::vector<double>
charge;
207 std::vector<std::pair<SUMOTime, SUMOTime> > vectorBeginEndCharge;
211 vectorBeginEndCharge.push_back(std::pair<SUMOTime, SUMOTime>(firsTimeStep, 0));
215 charge.back() += i->WCharged;
217 vectorBeginEndCharge.back().second = i->timeStep;
219 firsTimeStep += 1000;
221 if (((i + 1) !=
myChargeValues.end()) && (((i + 1)->timeStep) != firsTimeStep)) {
223 firsTimeStep = (i + 1)->timeStep;
225 vectorBeginEndCharge.push_back(std::pair<SUMOTime, SUMOTime>(firsTimeStep, 0));
230 int vehicleCounter = 0;
256 firsTimeStep += 1000;
258 if (((i + 1) !=
myChargeValues.end()) && (((i + 1)->timeStep) != firsTimeStep)) {
260 firsTimeStep = (i + 1)->timeStep;
void addChargeValueForOutput(double WCharged, MSDevice_Battery *battery)
add charge value for output
number of steps that a vehicle is charging
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
bool isCharging() const
Return true if in the current time step charging station is charging a vehicle.
double myTotalCharge
total energy charged by this charging station
A lane area vehicles can halt at.
MSChargingStation(const std::string &chargingStationID, MSLane &lane, double startPos, double endPos, double chargingPower, double efficency, bool chargeInTransit, int chargeDelay)
constructor
~MSChargingStation()
destructor
void setChargeDelay(int chargeDelay)
Set charge delay of the charging station.
double getActualBatteryCapacity() const
Get the actual vehicle's Battery Capacity in kWh.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
double getEndLanePosition() const
Returns the end position of this stop.
SUMOVehicle & getHolder() const
Returns the vehicle that holds this device.
double getStoppingTreshold() const
Get stopping treshold.
#define WRITE_WARNING(msg)
void setEfficency(double efficency)
Set efficiency of the charging station.
double getMaximumBatteryCapacity() const
Get the total vehicle's Battery Capacity in kWh.
bool myChargingVehicle
Check if in the current TimeStep chargingStation is charging a vehicle.
const std::string & getID() const
Returns the id.
virtual double getSpeed() const =0
Returns the vehicle's current speed.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
double getChargingStartTime() const
Get charging start time.
timesteps in which charging ends
bool getChargeInTransit() const
Get chargeInTransit.
void setChargingVehicle(bool value)
enable or disable charging vehicle
energy provied by charging station at certain timestep
void setChargeInTransit(bool chargeInTransit)
Set charge in transit of the charging station.
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.
void writeChargingStationOutput(OutputDevice &output)
write charging station values
timestep in which charging begins
void setChargingPower(double chargingPower)
Set charging station's charging power.
struct to save information for the cahrgingStation output
std::string myID
The name of the object.
int myChargeDelay
Charge Delay.
trigger: the time of the step
Battery device for electric vehicles.
bool myChargeInTransit
Allow charge in transit.
double getChargeDelay() const
Get Charge Delay.
double getChargingPower() const
Get charging station's charging power.
total energy charged into a single vehicle
const std::string & getID() const
Returns the name of the vehicle type.
virtual const std::string & getID() const =0
Get the vehicle's ID.
double myEfficiency
Efficiency of the charging station.
std::vector< charge > myChargeValues
vector with the charges of this charging station
double getBeginLanePosition() const
Returns the begin position of this stop.
Static storage of an output device and its base (abstract) implementation.
Eficiency of the charge in Charging Stations.
double getEfficency() const
Get efficiency of the charging station.
bool closeTag()
Closes the most recently opened tag.
Delay in the charge of charging stations.
Representation of a lane in the micro simulation.
double myChargingPower
Charging station's charging power.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
bool vehicleIsInside(const double position) const
Check if a vehicle is inside in the Charge Station.
trigger: a step description