Eclipse SUMO - Simulation of Urban MObility
MSChargingStation.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
16 // Chargin Station for Electric vehicles
17 /****************************************************************************/
18 #ifndef MSChargingStation_h
19 #define MSChargingStation_h
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <list>
27 #include <string>
28 #include <iostream>
29 #include <fstream>
30 #include <sstream>
32 
33 
34 // ===========================================================================
35 // class declarations
36 // ===========================================================================
37 class MSLane;
38 class MSBusStop;
39 class OptionsCont;
41 
42 
43 // ===========================================================================
44 // class definitions
45 // ===========================================================================
51 public:
52 
54  MSChargingStation(const std::string& chargingStationID, MSLane& lane, double startPos, double endPos,
55  const std::string& name,
56  double chargingPower, double efficency, bool chargeInTransit, double chargeDelay);
57 
60 
62  double getChargingPower() const;
63 
65  double getEfficency() const;
66 
68  bool getChargeInTransit() const;
69 
71  double getChargeDelay() const;
72 
74  void setChargingPower(double chargingPower);
75 
77  void setEfficency(double efficency);
78 
80  void setChargeInTransit(bool chargeInTransit);
81 
83  void setChargeDelay(double chargeDelay);
84 
86  void setChargingVehicle(bool value);
87 
92  bool vehicleIsInside(const double position) const;
93 
95  bool isCharging() const;
96 
97  double getTotalCharged() const {
98  return myTotalCharge;
99  }
100 
102  void addChargeValueForOutput(double WCharged, MSDevice_Battery* battery);
103 
106 
107 protected:
108 
110  struct charge {
112  charge(SUMOTime _timeStep, std::string _vehicleID, std::string _vehicleType, std::string _status,
113  double _WCharged, double _actualBatteryCapacity, double _maxBatteryCapacity, double _chargingPower,
114  double _chargingEfficiency, double _totalEnergyCharged) :
115  timeStep(_timeStep),
116  vehicleID(_vehicleID),
117  vehicleType(_vehicleType),
118  status(_status),
119  WCharged(_WCharged),
120  actualBatteryCapacity(_actualBatteryCapacity),
121  maxBatteryCapacity(_maxBatteryCapacity),
122  chargingPower(_chargingPower),
123  chargingEfficiency(_chargingEfficiency),
124  totalEnergyCharged(_totalEnergyCharged) {}
125 
126  // @brief vehicle TimeStep
128  // @brief vehicle ID
129  std::string vehicleID;
130  // @brief vehicle Type
131  std::string vehicleType;
133  std::string status;
134  // @brief W charged
135  double WCharged;
136  // @brief actual battery capacity AFTER charging
138  // @brief battery max capacity
140  // @brief current charging power of charging station
142  // @brief current efficiency of charging station
144  // @brief current energy charged by charging stations AFTER charging
146  };
147 
150 
152  double myEfficiency;
153 
156 
159 
162 
165 
167  std::vector<charge> myChargeValues;
168 
169 private:
172 
175 };
176 
177 #endif
MSChargingStation::charge::vehicleType
std::string vehicleType
Definition: MSChargingStation.h:131
MSChargingStation::getChargingPower
double getChargingPower() const
Get charging station's charging power.
Definition: MSChargingStation.cpp:79
MSStoppingPlace
A lane area vehicles can halt at.
Definition: MSStoppingPlace.h:59
MSLane
Representation of a lane in the micro simulation.
Definition: MSLane.h:82
OutputDevice
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:63
MSChargingStation::myChargeInTransit
bool myChargeInTransit
Allow charge in transit.
Definition: MSChargingStation.h:155
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
MSChargingStation::setChargeDelay
void setChargeDelay(double chargeDelay)
Set charge delay of the charging station.
Definition: MSChargingStation.cpp:129
MSChargingStation::myChargeValues
std::vector< charge > myChargeValues
vector with the charges of this charging station
Definition: MSChargingStation.h:167
MSChargingStation::charge::WCharged
double WCharged
Definition: MSChargingStation.h:135
MSChargingStation::myChargeDelay
double myChargeDelay
Charge Delay.
Definition: MSChargingStation.h:158
MSChargingStation::~MSChargingStation
~MSChargingStation()
destructor
Definition: MSChargingStation.cpp:74
MSChargingStation::charge::status
std::string status
status
Definition: MSChargingStation.h:133
MSChargingStation::charge::charge
charge(SUMOTime _timeStep, std::string _vehicleID, std::string _vehicleType, std::string _status, double _WCharged, double _actualBatteryCapacity, double _maxBatteryCapacity, double _chargingPower, double _chargingEfficiency, double _totalEnergyCharged)
constructor
Definition: MSChargingStation.h:112
MSChargingStation::charge
struct to save information for the cahrgingStation output
Definition: MSChargingStation.h:110
MSChargingStation::setChargingVehicle
void setChargingVehicle(bool value)
enable or disable charging vehicle
Definition: MSChargingStation.cpp:139
MSChargingStation::setChargeInTransit
void setChargeInTransit(bool chargeInTransit)
Set charge in transit of the charging station.
Definition: MSChargingStation.cpp:123
MSChargingStation::getEfficency
double getEfficency() const
Get efficiency of the charging station.
Definition: MSChargingStation.cpp:85
MSChargingStation::myTotalCharge
double myTotalCharge
total energy charged by this charging station
Definition: MSChargingStation.h:164
MSChargingStation::setEfficency
void setEfficency(double efficency)
Set efficiency of the charging station.
Definition: MSChargingStation.cpp:113
MSChargingStation::charge::chargingPower
double chargingPower
Definition: MSChargingStation.h:141
MSChargingStation::charge::maxBatteryCapacity
double maxBatteryCapacity
Definition: MSChargingStation.h:139
MSChargingStation::writeChargingStationOutput
void writeChargingStationOutput(OutputDevice &output)
write charging station values
Definition: MSChargingStation.cpp:191
MSChargingStation::myEfficiency
double myEfficiency
Efficiency of the charging station.
Definition: MSChargingStation.h:152
MSChargingStation::myChargingPower
double myChargingPower
Charging station's charging power.
Definition: MSChargingStation.h:149
MSChargingStation
Definition: MSChargingStation.h:50
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:89
MSDevice_Battery
Battery device for electric vehicles.
Definition: MSDevice_Battery.h:45
MSChargingStation::myChargingVehicle
bool myChargingVehicle
Check if in the current TimeStep chargingStation is charging a vehicle.
Definition: MSChargingStation.h:161
MSChargingStation::charge::vehicleID
std::string vehicleID
Definition: MSChargingStation.h:129
MSChargingStation::charge::actualBatteryCapacity
double actualBatteryCapacity
Definition: MSChargingStation.h:137
MSChargingStation::MSChargingStation
MSChargingStation(const std::string &chargingStationID, MSLane &lane, double startPos, double endPos, const std::string &name, double chargingPower, double efficency, bool chargeInTransit, double chargeDelay)
constructor
Definition: MSChargingStation.cpp:40
MSChargingStation::setChargingPower
void setChargingPower(double chargingPower)
Set charging station's charging power.
Definition: MSChargingStation.cpp:103
MSChargingStation::operator=
MSChargingStation & operator=(const MSChargingStation &)
Invalidated assignment operator.
MSChargingStation::isCharging
bool isCharging() const
Return true if in the current time step charging station is charging a vehicle.
Definition: MSChargingStation.cpp:155
MSChargingStation::getTotalCharged
double getTotalCharged() const
Definition: MSChargingStation.h:97
MSChargingStation::vehicleIsInside
bool vehicleIsInside(const double position) const
Check if a vehicle is inside in the Charge Station.
Definition: MSChargingStation.cpp:145
MSChargingStation::charge::totalEnergyCharged
double totalEnergyCharged
Definition: MSChargingStation.h:145
config.h
MSChargingStation::addChargeValueForOutput
void addChargeValueForOutput(double WCharged, MSDevice_Battery *battery)
add charge value for output
Definition: MSChargingStation.cpp:161
MSChargingStation::getChargeDelay
double getChargeDelay() const
Get Charge Delay.
Definition: MSChargingStation.cpp:97
MSStoppingPlace.h
MSChargingStation::getChargeInTransit
bool getChargeInTransit() const
Get chargeInTransit.
Definition: MSChargingStation.cpp:91
MSChargingStation::charge::timeStep
SUMOTime timeStep
Definition: MSChargingStation.h:127
MSChargingStation::charge::chargingEfficiency
double chargingEfficiency
Definition: MSChargingStation.h:143