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  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
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.
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.
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&#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:78
double myChargingPower
Charging station&#39;s charging power.
double getTotalCharged() const