SUMO - Simulation of Urban MObility
MSChargingStation.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // Chargin Station for Electric vehicles
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef MSChargingStation_h
23 #define MSChargingStation_h
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <list>
35 #include <string>
36 #include <iostream>
37 #include <fstream>
38 #include <sstream>
40 
41 
42 // ===========================================================================
43 // class declarations
44 // ===========================================================================
45 class MSLane;
46 class MSBusStop;
47 class OptionsCont;
49 
50 
51 // ===========================================================================
52 // class definitions
53 // ===========================================================================
59 public:
60 
62  MSChargingStation(const std::string& chargingStationID, MSLane& lane, double startPos, double endPos,
63  double chargingPower, double efficency, bool chargeInTransit, int chargeDelay);
64 
67 
69  double getChargingPower() const;
70 
72  double getEfficency() const;
73 
75  bool getChargeInTransit() const;
76 
78  double getChargeDelay() const;
79 
81  void setChargingPower(double chargingPower);
82 
84  void setEfficency(double efficency);
85 
87  void setChargeInTransit(bool chargeInTransit);
88 
90  void setChargeDelay(int chargeDelay);
91 
93  void setChargingVehicle(bool value);
94 
99  bool vehicleIsInside(const double position) const;
100 
102  bool isCharging() const;
103 
105  void addChargeValueForOutput(double WCharged, MSDevice_Battery* battery);
106 
109 
110 protected:
111 
113  struct charge {
115  charge(SUMOTime _timeStep, std::string _vehicleID, std::string _vehicleType, std::string _status,
116  double _WCharged, double _actualBatteryCapacity, double _maxBatteryCapacity, double _chargingPower,
117  double _chargingEfficiency, double _totalEnergyCharged) :
118  timeStep(_timeStep),
119  vehicleID(_vehicleID),
120  vehicleType(_vehicleType),
121  status(_status),
122  WCharged(_WCharged),
123  actualBatteryCapacity(_actualBatteryCapacity),
124  maxBatteryCapacity(_maxBatteryCapacity),
125  chargingPower(_chargingPower),
126  chargingEfficiency(_chargingEfficiency),
127  totalEnergyCharged(_totalEnergyCharged) {}
128 
129  // @brief vehicle TimeStep
131  // @brief vehicle ID
132  std::string vehicleID;
133  // @brief vehicle Type
134  std::string vehicleType;
136  std::string status;
137  // @brief W charged
138  double WCharged;
139  // @brief actual battery capacity AFTER charging
141  // @brief battery max capacity
143  // @brief current charging power of charging station
145  // @brief current efficiency of charging station
147  // @brief current energy charged by charging stations AFTER charging
149  };
150 
153 
155  double myEfficiency;
156 
159 
162 
165 
168 
170  std::vector<charge> myChargeValues;
171 
172 private:
175 
178 };
179 
180 #endif
void addChargeValueForOutput(double WCharged, MSDevice_Battery *battery)
add charge value for output
double myTotalCharge
total energy charged by this charging station
MSChargingStation & operator=(const MSChargingStation &)
Invalidated assignment operator.
A lane area vehicles can halt at.
MSChargingStation(const std::string &chargingStationID, MSLane &lane, double startPos, double endPos, double chargingPower, double efficency, bool chargeInTransit, int chargeDelay)
constructor
~MSChargingStation()
destructor
void setChargeDelay(int chargeDelay)
Set charge delay of the charging station.
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 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
void setChargingPower(double chargingPower)
Set charging station&#39;s charging power.
struct to save information for the cahrgingStation output
int myChargeDelay
Charge Delay.
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:99
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:71
long long int SUMOTime
Definition: TraCIDefs.h:52
Representation of a lane in the micro simulation.
Definition: MSLane.h:79
double myChargingPower
Charging station&#39;s charging power.