Documentation of UrbanFireXDT
Documentation of UrbanFireXDT
Loading...
Searching...
No Matches
components.h
Go to the documentation of this file.
1/*
2 * components.h
3 *
4 * It contains all individual components
5 *
6 */
7
8#ifndef COMPONENTS_H
9#define COMPONENTS_H
10
11#include <map>
12#include <random>
13#include <string>
14#include <vector>
15
16// The following classes are defined in this header file:
17class BaseComponent;
19class RoofSectionPV;
20class ComponentPV;
21class ComponentBS;
22class ComponentHP;
23class ComponentCS;
24class EVFSM;
25
26#include "global.h"
27#include "vehicles.h"
28
29
34 public:
35 virtual ~BaseComponent() {}
36 // modifieres (on structural level of the simulation)
37 virtual void resetInternalState() = 0;
38 // modifiers (in the course of simulation time)
39 virtual void resetWeeklyCounter() = 0;
40};
41
50 public:
53 virtual double get_currentDemand_kW() const = 0;
54
63 const std::vector<double>* get_future_max_consumption_kWh() const { return &future_maxE_storage; }
64
73 const std::vector<double>* get_future_min_consumption_kWh() const { return &future_minE_storage; }
74
78 void set_horizon_in_ts(unsigned int new_horizon);
79
84 virtual void setDemandToProfileData(unsigned long ts) = 0;
85
93 virtual bool setDemandToGivenValue(double new_demand_kW) = 0;
94
95 protected:
96 // cached member variables
102 std::vector<double> future_maxE_storage;
108 std::vector<double> future_minE_storage;
109
110};
111
112
114 public:
115 RoofSectionPV(size_t locationID, float this_section_kWp, const std::string& orientation);
116 float get_generation_at_ts_kW(unsigned long ts) const;
117 float get_section_kWp() const { return this_section_kWp; }
118 const std::string& get_orientation() const { return orientation; }
119 size_t get_profile_index() const { return profile_index; }
120 // structural modifiers
121 void update_section_kWp(float new_kWp);
122 private:
123 // constant member variables
124 const float* profile_data;
125 float this_section_kWp; // not const, because it can be changed (e.g., by the optimization when integrating PV optimization)
126 const std::string orientation;
127 size_t profile_index;
128 //
129 // static data for selecting the next time series for expansion
130 static std::map<std::string, size_t> next_pv_idx;
131 // static data for selecting the next time series randomly
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;
134};
135
137 public:
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);
140 // getter methods
141 double get_kWp() const { return total_kWp; }
142 float get_currentGeneration_kW() const { return currentGeneration_kW; }
143 double get_cweek_generation_kWh(){ return generation_cumsum_cweek_kWh; }
144 double get_total_generation_kWh(){ return generation_cumsum_total_kWh; }
145 float get_generation_at_ts_kW(unsigned long ts) const;
146 std::string* get_section_string(const std::string& prefix_per_line);
152 const std::vector<double>* get_future_generation_kW() const { return &future_generation_kW; }
157 std::list<std::vector<double>> get_total_generation_by_section_kW() const;
163 std::list<double> get_kWp_per_section() const;
164 //
165 // update / action methods during simulation run
166 void calculateCurrentFeedin(unsigned long ts);
167 // methods for simulation reset
168 void resetWeeklyCounter();
169 void resetInternalState();
170 void set_horizon_in_ts(unsigned int new_horizon);
171 // modification methods for structural modifications
175 void set_kWp_per_section(const std::list<double>& new_values);
176 private:
177 // constant members
178 std::vector<RoofSectionPV> roof_sections;
179 // semi-constant member variables, i.e. they might change for parameter variations
180 float total_kWp;
181 // member variables that can change over time
182 float currentGeneration_kW;
183 std::vector<double> future_generation_kW;
184 double generation_cumsum_total_kWh;
185 double generation_cumsum_cweek_kWh;
186};
187
189 friend class EVFSM;
190 public:
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);
193 // getter methods
194 double get_SOC() const { return SOC; }
195 double get_SOE() const { return currentE_kWh; }
196 double get_currentCharge_kWh() const { return currentE_kWh; }
197 double get_currentLoad_kW() const { return currentP_kW; }
198 double get_gridOnly_discharge_kW() const { return currentP_from_grid_kW; }
199 double get_maxE_kWh() const { return maxE_kWh; }
200 double get_maxP_kW() const { return maxP_kW; }
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; }
203 unsigned long get_n_ts_empty() const { return n_ts_SOC_empty; }
204 unsigned long get_n_ts_full() const { return n_ts_SOC_full; }
205 double get_cweek_withdrawn_E_kWh() const { return cweek_E_withdrawn_kWh; }
206 double get_total_withdrawn_E_kWh() const { return total_E_withdrawn_kWh; }
207 double get_cweek_withdrawn_E_gridOnly_kWh() const { return cweek_E_withdrawn_from_grid_kWh; }
208 double get_total_withdrawn_E_gridOnly_kWh() const { return total_E_withdrawn_from_grid_kWh; }
209 // setter methods
210 void set_chargeRequest(double requested_charge_kW) { charge_request_kW = requested_charge_kW; }
211 void set_grid_charged_amount(double grid_charged_kW);
212 protected:
213 void set_SOE_without_computations(double new_SOE_kWh);
214 public:
215 void set_maxE_kWh(double value);
216 void set_maxP_kW (double value);
217 void set_maxP_by_EPRatio(double EP_ratio);
218 // update / action methods
219 void calculateActions();
220 void resetWeeklyCounter();
221 void resetInternalState();
222 private:
223 // semi-constant member variables, i.e. they might change for parameter variations
224 double maxE_kWh;
225 double maxP_kW;
226 double E_over_P_ratio;
227 // constant member variables (other languages might call this 'final')
228 const double discharge_rate_per_step;
229 const double efficiency_in;
230 const double efficiency_out;
231 const double initial_SoC;
232 // member variables that can change over time
233 double SOC;
234 double currentE_kWh;
235 double currentP_kW;
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;
245};
246
248 public:
249 ComponentHP(const ControlUnit* connected_unit, float annual_econs_kWh);
250 // getter methods
252 double get_currentDemand_kW() const { return currentDemand_kW; }
256 double get_total_consumption_kWh() const { return total_consumption_kWh; }
260 double get_cweek_consumption_kWh() const { return cweek_consumption_kWh; }
264 float get_rated_power_without_AUX() const { return rated_power_kW; }
265 //float get_demand_at_ts_kW(unsigned long ts) const; ///< Returns the demand of the heat pump at a given time step in kW. If there is no data available for this time step, 0.0 is returned.
274 const std::vector<double>* get_future_max_power_kW() const { return &future_maxP_storage; }
281 const std::vector<double>* get_future_min_power_kW() const { return &future_minP_storage; }
282
283 //
284 // update / action methods
286 void set_horizon_in_ts(unsigned int new_horizon);
290 void computeNextInternalState(unsigned long ts);
292 void setDemandToProfileData(unsigned long ts);
294 bool setDemandToGivenValue(double new_demand_kW);
295 void resetWeeklyCounter();
296 void resetInternalState();
297 //
298 // static methods for initializing the random generators
299 static void InitializeRandomGenerator();
300 static void VacuumStaticVariables();
301 private:
302 // constant member variables
303 const ControlUnit* connected_unit;
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;
309 // member variables that can change over time
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
320 // Variables for access protection of non-const methods during the simulation run
321 bool state_s1;
322#endif
323 //
324 // static data for selecting the next time series for expansion
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;
329};
330
338 public:
339 ComponentCS(ControlUnit* calling_control_unit, unsigned int number_of_flats);
340 ~ComponentCS();
341 // getters
342 bool is_enabled() const { return enabled; }
343 double get_max_P_kW() const;
344 double get_currentDemand_kW() const { return current_demand_kW; }
345 double get_total_consumption_kWh() const { return total_consumption_kWh; }
346 double get_cweek_consumption_kWh() const { return cweek_consumption_kWh; }
347 unsigned long get_n_EVs_pc() const;
348 unsigned long get_n_EVs_pnc() const;
349 unsigned long get_n_EVs() const;
350 unsigned long get_possible_n_EVs() const;
351 unsigned long get_control_unit_id() const;
352 std::vector<const EVFSM*> get_listOfEVs() const {
353 std::vector<const EVFSM*> const_list;
354 const_list.reserve(listOfEVs.size());
355 for (EVFSM* ev : listOfEVs) const_list.push_back(ev);
356 return const_list;
357 }
358 unsigned long get_n_chargers() const { return n_chargers; }
367 const std::vector<const std::vector<double>*>* get_future_max_consumption_kWh() const { return &future_maxE_storage; }
376 const std::vector<const std::vector<double>*>* get_future_min_consumption_kWh() const { return &future_minE_storage; }
382 const std::vector<const std::vector<double>*>* get_future_max_power_kW() const { return &future_maxP_storage; }
383 // modifieres (on structural level of the simulation)
384 void enable_station();
385 void disable_station();
386 void resetWeeklyCounter();
387 void resetInternalState();
388 void add_ev(unsigned long carID);
389 void set_horizon_in_ts(unsigned int new_horizon);
390 void preprocess_ev_data();
391 // modifiers (in the course of simulation time)
392 void setCarStatesForTimeStep(unsigned long ts);
393 void setDemandToProfileData(unsigned long ts);
394 bool setDemandToGivenValues(std::vector<double>& charging_power_per_EV_kW);
395 private:
396 // constant members
397 const ControlUnit* installation_place;
398 const unsigned long n_chargers;
399 double max_charging_power; // Not const, as the value might not be known on pre-initialization
400 // variable members, constant during one simulation run
401 bool enabled;
402 std::vector<EVFSM*> listOfEVs;
403 // variable members, variable during simulation run
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
411 // Variables for access protection of non-const methods during the simulation run
412 bool is_callable_setCarStatesForTimeStep;
413 bool is_callable_set_charging_value;
414#endif
415};
416
417
432
433 public:
434 EVFSM(unsigned long carID, ComponentCS* homeStation);
435 ~EVFSM();
436 // getters
437 EVState get_current_state() const { return current_state; }
438 // EVStateIfConnAtHome get_current_state_icah() const { return current_state_icah; } ///< Returns the current state of the EV iff it is connected at home
442 const std::vector<double>* get_future_max_power_kW() const { return &future_maxP_storage; }
443 double get_currentDemand_kW() const { return current_P_kW; }
444 std::string* get_metrics_string_annual();
445 const ComponentBS* get_battery() const { return battery; }
446 // modifiers (on structural level of the simulation)
448 void set_horizon_in_ts(unsigned int new_horizon);
449 void add_weekly_tour(short weekday, unsigned long departure_ts_of_day, unsigned long ts_duration, double tour_length_km, bool with_work);
451 void resetInternalState();
452 // modifiers (in the course of simulation time)
453 void setCarStateForTimeStep(unsigned long ts);
455 void setDemandToProfileData(unsigned long ts);
457 bool setDemandToGivenValue(double new_demand_kW);
460 // static methods
461 static const std::map<unsigned long, EVFSM*>& GetArrayOfInstances() { return list_of_cars; }
462 static unsigned long GetNumberOfEVs() { return list_of_cars.size(); }
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);
464 static void VacuumStaticVariables();
465 static void SetSeed(unsigned int seed);
466
467 private:
468 // constant members
469 const unsigned long carID;
470 const float econs_kWh_per_km;
471 ComponentCS const* homeStation;
472 // variable members (constant during a simulation run)
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;
481 // cached member variables
482 std::vector<double> future_maxP_storage;
483 // attached members
484 ComponentBS* battery;
485 // variable members, variable during a simulation run
486 EVState current_state;
487 unsigned long current_ts;
488 //EVStateIfConnAtHome current_state_icah; ///< Internal current state of the EV iff it is connected at home
489 double energy_demand_per_tour_ts;
490 double current_P_kW;
491 // variables for the final metrics calculation
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
498 // Variables for access protection of non-const methods during the simulation run
499 bool state_s1; // directly after initialization, tours can be added
500 bool state_s2; // ready for new/first time step, i.e., all tour information has been processed, no tours can be added anymore
501 bool state_s3; // EV internal state set to new time step, current demand can be set
502#endif
503 //
504 // class members
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 ;
508 public:
509 static const std::string MetricsStringHeaderAnnual;
510};
511
512#endif
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 units.h:162
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