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 /****************************************************************************/
17 // Chargin Station for Electric vehicles
18 /****************************************************************************/
19 #ifndef MSChargingStation_h
20 #define MSChargingStation_h
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <list>
28 #include <string>
29 #include <iostream>
30 #include <fstream>
31 #include <sstream>
33 
34 
35 // ===========================================================================
36 // class declarations
37 // ===========================================================================
38 class MSLane;
39 class MSBusStop;
40 class OptionsCont;
42 
43 
44 // ===========================================================================
45 // class definitions
46 // ===========================================================================
52 public:
53 
55  MSChargingStation(const std::string& chargingStationID, MSLane& lane, double startPos, double endPos,
56  const std::string& name,
57  double chargingPower, double efficency, bool chargeInTransit, double chargeDelay);
58 
61 
63  double getChargingPower() const;
64 
66  double getEfficency() const;
67 
69  bool getChargeInTransit() const;
70 
72  double getChargeDelay() const;
73 
75  void setChargingPower(double chargingPower);
76 
78  void setEfficency(double efficency);
79 
81  void setChargeInTransit(bool chargeInTransit);
82 
84  void setChargeDelay(double chargeDelay);
85 
87  void setChargingVehicle(bool value);
88 
93  bool vehicleIsInside(const double position) const;
94 
96  bool isCharging() const;
97 
98  double getTotalCharged() const {
99  return myTotalCharge;
100  }
101 
103  void addChargeValueForOutput(double WCharged, MSDevice_Battery* battery);
104 
107 
108 protected:
109 
111  struct charge {
113  charge(SUMOTime _timeStep, std::string _vehicleID, std::string _vehicleType, std::string _status,
114  double _WCharged, double _actualBatteryCapacity, double _maxBatteryCapacity, double _chargingPower,
115  double _chargingEfficiency, double _totalEnergyCharged) :
116  timeStep(_timeStep),
117  vehicleID(_vehicleID),
118  vehicleType(_vehicleType),
119  status(_status),
120  WCharged(_WCharged),
121  actualBatteryCapacity(_actualBatteryCapacity),
122  maxBatteryCapacity(_maxBatteryCapacity),
123  chargingPower(_chargingPower),
124  chargingEfficiency(_chargingEfficiency),
125  totalEnergyCharged(_totalEnergyCharged) {}
126 
127  // @brief vehicle TimeStep
129  // @brief vehicle ID
130  std::string vehicleID;
131  // @brief vehicle Type
132  std::string vehicleType;
134  std::string status;
135  // @brief W charged
136  double WCharged;
137  // @brief actual battery capacity AFTER charging
139  // @brief battery max capacity
141  // @brief current charging power of charging station
143  // @brief current efficiency of charging station
145  // @brief current energy charged by charging stations AFTER charging
147  };
148 
151 
153  double myEfficiency;
154 
157 
160 
163 
166 
168  std::vector<charge> myChargeValues;
169 
170 private:
173 
176 };
177 
178 #endif
MSChargingStation::charge::vehicleType
std::string vehicleType
Definition: MSChargingStation.h:132
MSChargingStation::getChargingPower
double getChargingPower() const
Get charging station's charging power.
Definition: MSChargingStation.cpp:80
MSStoppingPlace
A lane area vehicles can halt at.
Definition: MSStoppingPlace.h:60
MSLane
Representation of a lane in the micro simulation.
Definition: MSLane.h:83
OutputDevice
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:64
MSChargingStation::myChargeInTransit
bool myChargeInTransit
Allow charge in transit.
Definition: MSChargingStation.h:156
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:35
MSChargingStation::setChargeDelay
void setChargeDelay(double chargeDelay)
Set charge delay of the charging station.
Definition: MSChargingStation.cpp:130
MSChargingStation::myChargeValues
std::vector< charge > myChargeValues
vector with the charges of this charging station
Definition: MSChargingStation.h:168
MSChargingStation::charge::WCharged
double WCharged
Definition: MSChargingStation.h:136
MSChargingStation::myChargeDelay
double myChargeDelay
Charge Delay.
Definition: MSChargingStation.h:159
MSChargingStation::~MSChargingStation
~MSChargingStation()
destructor
Definition: MSChargingStation.cpp:75
MSChargingStation::charge::status
std::string status
status
Definition: MSChargingStation.h:134
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:113
MSChargingStation::charge
struct to save information for the cahrgingStation output
Definition: MSChargingStation.h:111
MSChargingStation::setChargingVehicle
void setChargingVehicle(bool value)
enable or disable charging vehicle
Definition: MSChargingStation.cpp:140
MSChargingStation::setChargeInTransit
void setChargeInTransit(bool chargeInTransit)
Set charge in transit of the charging station.
Definition: MSChargingStation.cpp:124
MSChargingStation::getEfficency
double getEfficency() const
Get efficiency of the charging station.
Definition: MSChargingStation.cpp:86
MSChargingStation::myTotalCharge
double myTotalCharge
total energy charged by this charging station
Definition: MSChargingStation.h:165
MSChargingStation::setEfficency
void setEfficency(double efficency)
Set efficiency of the charging station.
Definition: MSChargingStation.cpp:114
MSChargingStation::charge::chargingPower
double chargingPower
Definition: MSChargingStation.h:142
MSChargingStation::charge::maxBatteryCapacity
double maxBatteryCapacity
Definition: MSChargingStation.h:140
MSChargingStation::writeChargingStationOutput
void writeChargingStationOutput(OutputDevice &output)
write charging station values
Definition: MSChargingStation.cpp:192
MSChargingStation::myEfficiency
double myEfficiency
Efficiency of the charging station.
Definition: MSChargingStation.h:153
MSChargingStation::myChargingPower
double myChargingPower
Charging station's charging power.
Definition: MSChargingStation.h:150
MSChargingStation
Definition: MSChargingStation.h:51
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:90
MSDevice_Battery
Battery device for electric vehicles.
Definition: MSDevice_Battery.h:46
MSChargingStation::myChargingVehicle
bool myChargingVehicle
Check if in the current TimeStep chargingStation is charging a vehicle.
Definition: MSChargingStation.h:162
MSChargingStation::charge::vehicleID
std::string vehicleID
Definition: MSChargingStation.h:130
MSChargingStation::charge::actualBatteryCapacity
double actualBatteryCapacity
Definition: MSChargingStation.h:138
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:41
MSChargingStation::setChargingPower
void setChargingPower(double chargingPower)
Set charging station's charging power.
Definition: MSChargingStation.cpp:104
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:156
MSChargingStation::getTotalCharged
double getTotalCharged() const
Definition: MSChargingStation.h:98
MSChargingStation::vehicleIsInside
bool vehicleIsInside(const double position) const
Check if a vehicle is inside in the Charge Station.
Definition: MSChargingStation.cpp:146
MSChargingStation::charge::totalEnergyCharged
double totalEnergyCharged
Definition: MSChargingStation.h:146
config.h
MSChargingStation::addChargeValueForOutput
void addChargeValueForOutput(double WCharged, MSDevice_Battery *battery)
add charge value for output
Definition: MSChargingStation.cpp:162
MSChargingStation::getChargeDelay
double getChargeDelay() const
Get Charge Delay.
Definition: MSChargingStation.cpp:98
MSStoppingPlace.h
MSChargingStation::getChargeInTransit
bool getChargeInTransit() const
Get chargeInTransit.
Definition: MSChargingStation.cpp:92
MSChargingStation::charge::timeStep
SUMOTime timeStep
Definition: MSChargingStation.h:128
MSChargingStation::charge::chargingEfficiency
double chargingEfficiency
Definition: MSChargingStation.h:144