115 RoofSectionPV(
size_t locationID,
float this_section_kWp,
const std::string& orientation);
124 const float* profile_data;
125 float this_section_kWp;
126 const std::string orientation;
127 size_t profile_index;
130 static std::map<std::string, size_t> next_pv_idx;
132 static std::map<std::string, std::default_random_engine> random_generators;
133 static std::map<std::string, std::uniform_int_distribution<size_t>> distributions;
138 ComponentPV(
float kWp_static,
unsigned long locationID);
139 ComponentPV(
float kWp_per_m2,
float min_kWp_sec,
float max_kWp_sec,
float max_kWp_unit,
unsigned long locationID);
178 std::vector<RoofSectionPV> roof_sections;
182 float currentGeneration_kW;
183 std::vector<double> future_generation_kW;
184 double generation_cumsum_total_kWh;
185 double generation_cumsum_cweek_kWh;
191 ComponentBS(
double maxE_kWh,
double maxP_kW,
double E_over_P_ratio,
double discharge_rate_per_step,
double efficiency_in,
double efficiency_out,
double initial_SoC);
192 ComponentBS(
double maxE_kWh,
double discharge_rate_per_step,
double efficiency_in,
double initial_SoC);
195 double get_SOE()
const {
return currentE_kWh; }
201 double get_current_EFC()
const {
return (maxE_kWh > 0) ? total_E_withdrawn_kWh / maxE_kWh : 0.0; }
202 double get_cweek_EFC()
const {
return (maxE_kWh > 0) ? cweek_E_withdrawn_kWh / maxE_kWh : 0.0; }
226 double E_over_P_ratio;
228 const double discharge_rate_per_step;
229 const double efficiency_in;
230 const double efficiency_out;
231 const double initial_SoC;
236 double currentE_from_grid_kWh;
237 double currentP_from_grid_kW;
238 double charge_request_kW;
239 double cweek_E_withdrawn_kWh;
240 double total_E_withdrawn_kWh;
241 double cweek_E_withdrawn_from_grid_kWh;
242 double total_E_withdrawn_from_grid_kWh;
243 unsigned long n_ts_SOC_empty;
244 unsigned long n_ts_SOC_full;
304 const float yearly_electricity_consumption_kWh;
305 const float scaling_factor;
306 const float* profile_data;
307 const double* profile_cumsum;
308 float rated_power_kW;
310 double currentDemand_kW;
311 double total_consumption_kWh;
312 double cweek_consumption_kWh;
317 std::vector<double> future_maxP_storage;
318 std::vector<double> future_minP_storage;
319#ifdef ADD_METHOD_ACCESS_PROTECTION_VARS
325 static size_t next_hp_idx;
326 static bool random_generator_init;
327 static std::default_random_engine* random_generator;
328 static std::uniform_int_distribution<size_t>* distribution;
353 std::vector<const EVFSM*> const_list;
354 const_list.reserve(listOfEVs.size());
355 for (
EVFSM* ev : listOfEVs) const_list.push_back(ev);
388 void add_ev(
unsigned long carID);
398 const unsigned long n_chargers;
399 double max_charging_power;
402 std::vector<EVFSM*> listOfEVs;
404 double current_demand_kW;
405 double total_consumption_kWh;
406 double cweek_consumption_kWh;
407 std::vector<const std::vector<double>*> future_maxE_storage;
408 std::vector<const std::vector<double>*> future_minE_storage;
409 std::vector<const std::vector<double>*> future_maxP_storage;
410#ifdef ADD_METHOD_ACCESS_PROTECTION_VARS
412 bool is_callable_setCarStatesForTimeStep;
413 bool is_callable_set_charging_value;
449 void add_weekly_tour(
short weekday,
unsigned long departure_ts_of_day,
unsigned long ts_duration,
double tour_length_km,
bool with_work);
463 static void AddWeeklyTour(
unsigned long carID,
short weekday,
unsigned long departure_ts_of_day,
unsigned long ts_duration,
double tour_length_km,
bool with_work);
465 static void SetSeed(
unsigned int seed);
469 const unsigned long carID;
470 const float econs_kWh_per_km;
473 std::vector<std::vector<WeeklyVehicleTour>*> list_of_tours_pd;
474 std::vector<WeeklyVehicleTour*> list_of_all_tours;
475 std::vector<EVState> prec_vec_of_states;
476 std::vector<double> prec_vec_of_minE;
477 std::vector<double> prec_vec_of_maxE;
478 std::vector<double> prec_vec_of_driving_distance_km;
479 std::vector<float> prec_vec_of_maxP_kW;
480 std::vector<double> prec_vec_of_curr_BS_E_cons_kWh;
482 std::vector<double> future_maxP_storage;
487 unsigned long current_ts;
489 double energy_demand_per_tour_ts;
492 double sum_of_driving_distance_km;
493 double sum_of_E_used_for_driving_kWh;
494 double sum_of_E_charged_home_kWh;
495 double sum_of_E_discharged_home_kWh;
496 ulong sum_of_ts_EV_is_connected;
497#ifdef ADD_METHOD_ACCESS_PROTECTION_VARS
505 static std::map<unsigned long, EVFSM*> list_of_cars;
506 static std::default_random_engine* random_generator;
507 static std::uniform_real_distribution<float>* distribution ;
Definition components.h:49
virtual void setDemandToProfileData(unsigned long ts)=0
std::vector< double > future_minE_storage
Definition components.h:108
const std::vector< double > * get_future_max_consumption_kWh() const
Definition components.h:63
std::vector< double > future_maxE_storage
Definition components.h:102
~BaseComponentSemiFlexible()
Definition components.cpp:29
void set_horizon_in_ts(unsigned int new_horizon)
Definition components.cpp:32
const std::vector< double > * get_future_min_consumption_kWh() const
Definition components.h:73
virtual bool setDemandToGivenValue(double new_demand_kW)=0
virtual double get_currentDemand_kW() const =0
BaseComponentSemiFlexible()
Definition components.cpp:24
Definition components.h:33
virtual void resetInternalState()=0
Resets the internal simulation state (like counters), but retains the structural state like attached ...
virtual void resetWeeklyCounter()=0
Resets the internal, weekly counters.
virtual ~BaseComponent()
Definition components.h:35
Definition components.h:188
unsigned long get_n_ts_empty() const
Returns the number of time steps where the battery is empty.
Definition components.h:203
double get_maxP_kW() const
Returns the maximum available capacity of the battery. For the current power, see ComponentBS::get_cu...
Definition components.h:200
void set_maxP_by_EPRatio(double EP_ratio)
Definition components.cpp:467
void calculateActions()
Definition components.cpp:474
void resetInternalState()
Resets the internal simulation state (like counters), but retains the structural state like attached ...
Definition components.cpp:533
double get_SOC() const
Returns the current state of charge of the battery.
Definition components.h:194
void resetWeeklyCounter()
Resets the internal, weekly counters.
Definition components.cpp:528
double get_maxE_kWh() const
Returns the maximum available capacity of the battery. For the current state of energy / charge,...
Definition components.h:199
double get_currentCharge_kWh() const
Returns the charge of the battery (i.e. how much kWh are stored inside). Equivalent to ComponentBS::g...
Definition components.h:196
void set_SOE_without_computations(double new_SOE_kWh)
Changes the current SOE without updating other internal variables! Should only be used by class EVFSM...
Definition components.cpp:450
void set_chargeRequest(double requested_charge_kW)
Definition components.h:210
void set_maxE_kWh(double value)
Definition components.cpp:454
double get_cweek_EFC() const
Returns the equivalent full cycles (EFC) for the current week only.
Definition components.h:202
void set_grid_charged_amount(double grid_charged_kW)
Sets the amount that has been charged from the grid (and not from the PV) for the current step....
Definition components.cpp:437
double get_cweek_withdrawn_E_gridOnly_kWh() const
Returns the total energy that is taken from the battery and that was initially charged from the grid ...
Definition components.h:207
double get_current_EFC() const
Returns the equivalent full cycles (EFC)
Definition components.h:201
double get_total_withdrawn_E_gridOnly_kWh() const
Returns the total energy that is taken from the battery and that was initially charged from the grid ...
Definition components.h:208
void set_maxP_kW(double value)
Definition components.cpp:460
unsigned long get_n_ts_full() const
Returns the number of time steps where the battery is fully charged.
Definition components.h:204
double get_SOE() const
Returns the current amount of energy stored in the battery. Equivalent to ComponentBS::get_currentCha...
Definition components.h:195
double get_currentLoad_kW() const
Returns the current load of the battery (from outside perspective). Positive values denotes battery c...
Definition components.h:197
double get_total_withdrawn_E_kWh() const
Returns the total energy that is taken from the battery from the beginning of the simulation run unti...
Definition components.h:206
double get_gridOnly_discharge_kW() const
Returns the amount of energy that is currently discharged, see ComponentBS::get_currentLoad_kW() if s...
Definition components.h:198
double get_cweek_withdrawn_E_kWh() const
Returns the total energy that is taken from the battery from the beginning of the current week until ...
Definition components.h:205
Definition components.h:337
void add_ev(unsigned long carID)
Definition components.cpp:881
double get_cweek_consumption_kWh() const
Returns the total consumed energy in kWh after the current time step. Only valid after the call of se...
Definition components.h:346
void set_horizon_in_ts(unsigned int new_horizon)
Sets another horizon for the number of time steps returned by ComponentCS::get_future_min_consumption...
Definition components.cpp:890
unsigned long get_possible_n_EVs() const
Returns the number of possible connected EVs if the component would be enabled.
Definition components.cpp:853
double get_currentDemand_kW() const
Returns the current power in kW for the current time step. Only valid after the call of set_charging_...
Definition components.h:344
void preprocess_ev_data()
Preprocesses EV data, calls EVFSM::preprocessTourInformation() for all attached EVs....
Definition components.cpp:896
void resetInternalState()
Resets the internal simulation state (like counters), but retains the structural state like attached ...
Definition components.cpp:869
const std::vector< const std::vector< double > * > * get_future_max_consumption_kWh() const
Definition components.h:367
std::vector< const EVFSM * > get_listOfEVs() const
Returns a reference to the internal list of EVs.
Definition components.h:352
unsigned long get_control_unit_id() const
Returns the control unit ID of the installation place.
Definition components.cpp:849
const std::vector< const std::vector< double > * > * get_future_min_consumption_kWh() const
Definition components.h:376
double get_max_P_kW() const
Returns the maximum available charging power for this station in kW (regardless if this is currently ...
Definition components.cpp:829
bool setDemandToGivenValues(std::vector< double > &charging_power_per_EV_kW)
Sets the charging demand (in kW) per EV as given by any contoller. If this method is called once duri...
Definition components.cpp:986
const std::vector< const std::vector< double > * > * get_future_max_power_kW() const
Definition components.h:382
void setDemandToProfileData(unsigned long ts)
Sets the charging demand to the (immediate charging) profile value. If this method is called once dur...
Definition components.cpp:926
void disable_station()
Definition components.cpp:861
void resetWeeklyCounter()
Resets the internal, weekly counters.
Definition components.cpp:865
~ComponentCS()
Definition components.cpp:824
void setCarStatesForTimeStep(unsigned long ts)
Sets the car states for all attached EVs for a new time step 'ts'. This method must be called with st...
Definition components.cpp:902
double get_total_consumption_kWh() const
Returns the total consumed energy in kWh after the current time step. Only valid after the call of se...
Definition components.h:345
unsigned long get_n_EVs_pnc() const
Returns the number of EVs that are currently at home AND NOT connected with the station.
Definition components.cpp:839
bool is_enabled() const
Definition components.h:342
void enable_station()
Definition components.cpp:857
unsigned long get_n_chargers() const
Returns the number of chargers available at this charging station (typically the number of flats of t...
Definition components.h:358
unsigned long get_n_EVs() const
Returns the number of connected EVs if the component is enabled, otherwise 0 is returned.
Definition components.cpp:843
unsigned long get_n_EVs_pc() const
Returns the number of EVs that are currently at home AND connected with the station.
Definition components.cpp:835
Definition components.h:247
float get_rated_power_without_AUX() const
Definition components.h:264
static void VacuumStaticVariables()
Definition components.cpp:786
static void InitializeRandomGenerator()
Definition components.cpp:773
bool setDemandToGivenValue(double new_demand_kW)
Definition components.cpp:701
double get_cweek_consumption_kWh() const
Definition components.h:260
void resetWeeklyCounter()
Resets the internal, weekly counters.
Definition components.cpp:763
const std::vector< double > * get_future_min_power_kW() const
Definition components.h:281
double get_total_consumption_kWh() const
Definition components.h:256
void setDemandToProfileData(unsigned long ts)
Definition components.cpp:685
const std::vector< double > * get_future_max_power_kW() const
Definition components.h:274
void computeNextInternalState(unsigned long ts)
Definition components.cpp:628
double get_currentDemand_kW() const
Definition components.h:252
void set_horizon_in_ts(unsigned int new_horizon)
Definition components.cpp:620
void resetInternalState()
Resets the internal simulation state (like counters), but retains the structural state like attached ...
Definition components.cpp:767
Definition components.h:136
void set_horizon_in_ts(unsigned int new_horizon)
Sets another horizon for the number of time steps returned by ComponentPV::get_future_generation_kW()
Definition components.cpp:332
std::string * get_section_string(const std::string &prefix_per_line)
Returns a string listing information about all existing, simulated roof sections - one line per secti...
Definition components.cpp:259
void set_kWp_per_section(const std::list< double > &new_values)
Definition components.cpp:337
float get_generation_at_ts_kW(unsigned long ts) const
Returns the generation at a given time step in kW. If there is no data available for this time step,...
Definition components.cpp:249
double get_kWp() const
Returns the total peak power, summed over all sections. See also ComponentPV::get_kWp_per_section().
Definition components.h:141
std::list< double > get_kWp_per_section() const
Definition components.cpp:298
double get_cweek_generation_kWh()
Returns the produced energy in kWh from the start of the current week until the current time step.
Definition components.h:143
void resetWeeklyCounter()
Resets the internal, weekly counters.
Definition components.cpp:322
void calculateCurrentFeedin(unsigned long ts)
Definition components.cpp:308
float get_currentGeneration_kW() const
Definition components.h:142
double get_total_generation_kWh()
Returns the total produced energy in kWh from the start of the simulation run until the current time ...
Definition components.h:144
std::list< std::vector< double > > get_total_generation_by_section_kW() const
Definition components.cpp:280
const std::vector< double > * get_future_generation_kW() const
Definition components.h:152
void resetInternalState()
Resets the internal simulation state (like counters), but retains the structural state like attached ...
Definition components.cpp:326
Definition components.h:431
static void SetSeed(unsigned int seed)
Sets the seed for the EVFSM-class random number generator.
Definition components.cpp:1489
void add_weekly_tour(short weekday, unsigned long departure_ts_of_day, unsigned long ts_duration, double tour_length_km, bool with_work)
This method adds a home-centered car tour to the current car. All parameters that represent a time mu...
Definition components.cpp:1096
void set_horizon_in_ts(unsigned int new_horizon)
Definition components.cpp:1090
void setCarStateForTimeStep(unsigned long ts)
Sets the car state for a new time step 'ts'. This method must be called with strictly consecutive val...
Definition components.cpp:1347
void resetWeeklyCounter()
Do nothing. The EV has no weekly metrics.
Definition components.h:459
static unsigned long GetNumberOfEVs()
Definition components.h:462
EVState get_current_state() const
Definition components.h:437
const ComponentBS * get_battery() const
Returns a reference to the battery component of the EV.
Definition components.h:445
std::string * get_metrics_string_annual()
Returns some metrics as string (useful for the output). Header see EVFSM::MetricsStringHeaderAnnual....
Definition components.cpp:1078
bool setDemandToGivenValue(double new_demand_kW)
Definition components.cpp:1427
void preprocessTourInformation()
Transforms the list of weekly tours into a list of tours for the complete simulation time span and co...
Definition components.cpp:1153
const std::vector< double > * get_future_max_power_kW() const
Returns the maximum power of this EV per time step in the controller horizon. Attention: Returned obj...
Definition components.h:442
static const std::map< unsigned long, EVFSM * > & GetArrayOfInstances()
Returns the map of all existing instances. The objects itself are mutable, but the map reference is c...
Definition components.h:461
void resetInternalState()
Resets the internal state.
Definition components.cpp:1334
~EVFSM()
Definition components.cpp:1067
static const std::string MetricsStringHeaderAnnual
The header for the output string produced by EVFSM::get_metrics_string_annual()
Definition components.h:509
static void VacuumStaticVariables()
Definition components.cpp:1485
static void AddWeeklyTour(unsigned long carID, short weekday, unsigned long departure_ts_of_day, unsigned long ts_duration, double tour_length_km, bool with_work)
This class method adds a home-centered car tour to the car with ID carID. All parameters that represe...
Definition components.cpp:1477
double get_currentDemand_kW() const
Gets the current charging power in kW; Only valid after calling EVFSM::setDemandToProfileData() or EV...
Definition components.h:443
void setDemandToProfileData(unsigned long ts)
Definition components.cpp:1396
Definition components.h:113
const std::string & get_orientation() const
Definition components.h:118
void update_section_kWp(float new_kWp)
This structural modifier sets a new kWp for the roof section.
Definition components.cpp:115
size_t get_profile_index() const
Definition components.h:119
float get_section_kWp() const
Definition components.h:117
float get_generation_at_ts_kW(unsigned long ts) const
Returns the current feed in at a given time step. This method does not change the object....
Definition components.cpp:110
EVState
Definition vehicles.h:42