42 const std::string& name,
43 double chargingPower,
double efficency,
bool chargeInTransit,
double chargeDelay) :
44 MSStoppingPlace(chargingStationID, std::vector<std::string>(), lane, startPos, endPos, name),
47 myChargeInTransit(chargeInTransit),
49 myChargingVehicle(false),
51 if (chargingPower < 0)
57 if (efficency < 0 || efficency > 1) {
63 if (chargeDelay < 0) {
105 if (chargingPower < 0) {
115 if (efficency < 0 || efficency > 1) {
131 if (chargeDelay < 0) {
163 std::string status =
"";
166 status =
"chargingStopped";
168 status =
"chargingInTransit";
170 status =
"noCharging";
174 status =
"waitingChargeInTransit";
176 status =
"waitingChargeStopped";
178 status =
"noWaitingCharge";
200 std::vector<double>
charge;
201 std::vector<std::pair<SUMOTime, SUMOTime> > vectorBeginEndCharge;
205 vectorBeginEndCharge.push_back(std::pair<SUMOTime, SUMOTime>(firsTimeStep, 0));
209 charge.back() += i->WCharged;
211 vectorBeginEndCharge.back().second = i->timeStep;
213 firsTimeStep += 1000;
215 if (((i + 1) !=
myChargeValues.end()) && (((i + 1)->timeStep) != firsTimeStep)) {
217 firsTimeStep = (i + 1)->timeStep;
219 vectorBeginEndCharge.push_back(std::pair<SUMOTime, SUMOTime>(firsTimeStep, 0));
224 int vehicleCounter = 0;
250 firsTimeStep += 1000;
252 if (((i + 1) !=
myChargeValues.end()) && (((i + 1)->timeStep) != firsTimeStep)) {
254 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
double getStoppingTreshold() const
Get stopping treshold.
double getBeginLanePosition() const
Returns the begin position of this stop.
double getMaximumBatteryCapacity() const
Get the total vehicle's Battery Capacity in kWh.
double myTotalCharge
total energy charged by this charging station
A lane area vehicles can halt at.
double getChargingStartTime() const
Get charging start time.
~MSChargingStation()
destructor
double getActualBatteryCapacity() const
Get the actual vehicle's Battery Capacity in kWh.
std::string time2string(SUMOTime t)
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
const std::string & getID() const
Returns the id.
bool isCharging() const
Return true if in the current time step charging station is charging a vehicle.
#define WRITE_WARNING(msg)
void setEfficency(double efficency)
Set efficiency of the charging station.
bool getChargeInTransit() const
Get chargeInTransit.
bool myChargingVehicle
Check if in the current TimeStep chargingStation is charging a vehicle.
void setChargeDelay(double chargeDelay)
Set charge delay of the charging station.
double getEndLanePosition() const
Returns the end position of this stop.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
timesteps in which charging ends
void setChargingVehicle(bool value)
enable or disable charging vehicle
double getChargeDelay() const
Get Charge Delay.
bool vehicleIsInside(const double position) const
Check if a vehicle is inside in the Charge Station.
energy provied by charging station at certain timestep
void setChargeInTransit(bool chargeInTransit)
Set charge in transit of the charging station.
SUMOVehicle & getHolder() const
Returns the vehicle that holds this device.
void writeChargingStationOutput(OutputDevice &output)
write charging station values
timestep in which charging begins
double myChargeDelay
Charge Delay.
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.
trigger: the time of the step
double getEfficency() const
Get efficiency of the charging station.
Battery device for electric vehicles.
MSChargingStation(const std::string &chargingStationID, MSLane &lane, double startPos, double endPos, const std::string &name, double chargingPower, double efficency, bool chargeInTransit, double chargeDelay)
constructor
bool myChargeInTransit
Allow charge in transit.
double getChargingPower() const
Get charging station's charging power.
const std::string & getID() const
Returns the name of the vehicle type.
total energy charged into a single vehicle
double myEfficiency
Efficiency of the charging station.
std::vector< charge > myChargeValues
vector with the charges of this charging station
Static storage of an output device and its base (abstract) implementation.
Eficiency of the charge in Charging Stations.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
Delay in the charge of charging stations.
virtual double getSpeed() const =0
Returns the vehicle's current speed.
Representation of a lane in the micro simulation.
virtual const std::string & getID() const =0
Get the vehicle's ID.
double myChargingPower
Charging station's charging power.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
trigger: a step description
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.