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-2018 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  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
void addChargeValueForOutput(double WCharged, MSDevice_Battery *battery)
add charge value for output
long long int SUMOTime
Definition: SUMOTime.h:36
double myTotalCharge
total energy charged by this charging station
MSChargingStation & operator=(const MSChargingStation &)
Invalidated assignment operator.
A lane area vehicles can halt at.
~MSChargingStation()
destructor
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
bool isCharging() const
Return true if in the current time step charging station is charging a vehicle.
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.
MSChargingStation(const std::string &chargingStationID, MSLane &lane, double startPos, double endPos, double chargingPower, double efficency, bool chargeInTransit, double chargeDelay)
constructor
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.
void setChargeInTransit(bool chargeInTransit)
Set charge in transit of the charging station.
void writeChargingStationOutput(OutputDevice &output)
write charging station values
double myChargeDelay
Charge Delay.
void setChargingPower(double chargingPower)
Set charging station&#39;s charging power.
struct to save information for the cahrgingStation output
double getEfficency() const
Get efficiency of the charging station.
Battery device for electric vehicles.
bool myChargeInTransit
Allow charge in transit.
double getChargingPower() const
Get charging station&#39;s charging power.
A storage for options typed value containers)
Definition: OptionsCont.h:92
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.
Definition: OutputDevice.h:64
Representation of a lane in the micro simulation.
Definition: MSLane.h:71
double myChargingPower
Charging station&#39;s charging power.
double getTotalCharged() const