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-2020 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
20 // Chargin Station for Electric vehicles
21 /****************************************************************************/
22 #pragma once
23 #include <config.h>
24 
25 #include <list>
26 #include <string>
27 #include <iostream>
28 #include <fstream>
29 #include <sstream>
31 
32 
33 // ===========================================================================
34 // class declarations
35 // ===========================================================================
36 class MSLane;
37 class MSBusStop;
38 class OptionsCont;
39 class MSDevice_Battery;
40 
41 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
50 public:
51 
53  MSChargingStation(const std::string& chargingStationID, MSLane& lane, double startPos, double endPos,
54  const std::string& name,
55  double chargingPower, double efficency, bool chargeInTransit, double chargeDelay);
56 
59 
61  double getChargingPower() const;
62 
64  double getEfficency() const;
65 
67  bool getChargeInTransit() const;
68 
70  double getChargeDelay() const;
71 
73  void setChargingPower(double chargingPower);
74 
76  void setEfficency(double efficency);
77 
79  void setChargeInTransit(bool chargeInTransit);
80 
82  void setChargeDelay(double chargeDelay);
83 
85  void setChargingVehicle(bool value);
86 
91  bool vehicleIsInside(const double position) const;
92 
94  bool isCharging() const;
95 
96  double getTotalCharged() const {
97  return myTotalCharge;
98  }
99 
101  void addChargeValueForOutput(double WCharged, MSDevice_Battery* battery);
102 
105 
106 protected:
107 
109  struct charge {
111  charge(SUMOTime _timeStep, std::string _vehicleID, std::string _vehicleType, std::string _status,
112  double _WCharged, double _actualBatteryCapacity, double _maxBatteryCapacity, double _chargingPower,
113  double _chargingEfficiency, double _totalEnergyCharged) :
114  timeStep(_timeStep),
115  vehicleID(_vehicleID),
116  vehicleType(_vehicleType),
117  status(_status),
118  WCharged(_WCharged),
119  actualBatteryCapacity(_actualBatteryCapacity),
120  maxBatteryCapacity(_maxBatteryCapacity),
121  chargingPower(_chargingPower),
122  chargingEfficiency(_chargingEfficiency),
123  totalEnergyCharged(_totalEnergyCharged) {}
124 
125  // @brief vehicle TimeStep
127  // @brief vehicle ID
128  std::string vehicleID;
129  // @brief vehicle Type
130  std::string vehicleType;
132  std::string status;
133  // @brief W charged
134  double WCharged;
135  // @brief actual battery capacity AFTER charging
137  // @brief battery max capacity
139  // @brief current charging power of charging station
141  // @brief current efficiency of charging station
143  // @brief current energy charged by charging stations AFTER charging
145  };
146 
149 
151  double myEfficiency;
152 
155 
158 
161 
164 
166  std::vector<charge> myChargeValues;
167 
168 private:
171 
174 };
175 
long long int SUMOTime
Definition: SUMOTime.h:31
double myChargingPower
Charging station's charging power.
MSChargingStation & operator=(const MSChargingStation &)
Invalidated assignment operator.
void writeChargingStationOutput(OutputDevice &output)
write charging station values
double myTotalCharge
total energy charged by this charging station
double getChargingPower() const
Get charging station's charging power.
bool getChargeInTransit() const
Get chargeInTransit.
void setChargingVehicle(bool value)
enable or disable charging vehicle
void setEfficency(double efficency)
Set efficiency of the charging station.
double getChargeDelay() const
Get Charge Delay.
double myEfficiency
Efficiency of the charging station.
void setChargingPower(double chargingPower)
Set charging station's charging power.
void setChargeDelay(double chargeDelay)
Set charge delay of the charging station.
double myChargeDelay
Charge Delay.
bool myChargeInTransit
Allow charge in transit.
std::vector< charge > myChargeValues
vector with the charges of this charging station
bool vehicleIsInside(const double position) const
Check if a vehicle is inside in the Charge Station.
MSChargingStation(const std::string &chargingStationID, MSLane &lane, double startPos, double endPos, const std::string &name, double chargingPower, double efficency, bool chargeInTransit, double chargeDelay)
constructor
double getTotalCharged() const
void addChargeValueForOutput(double WCharged, MSDevice_Battery *battery)
add charge value for output
double getEfficency() const
Get efficiency of the charging station.
MSChargingStation(const MSChargingStation &)
Invalidated copy constructor.
~MSChargingStation()
destructor
bool myChargingVehicle
Check if in the current TimeStep chargingStation is charging a vehicle.
bool isCharging() const
Return true if in the current time step charging station is charging a vehicle.
void setChargeInTransit(bool chargeInTransit)
Set charge in transit of the charging station.
Battery device for electric vehicles.
Representation of a lane in the micro simulation.
Definition: MSLane.h:82
A lane area vehicles can halt at.
A storage for options typed value containers)
Definition: OptionsCont.h:89
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:60
struct to save information for the cahrgingStation output
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