Documentation of UrbanFireXDT
Documentation of UrbanFireXDT
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Friends | List of all members
ControlUnit Class Reference

#include <units.h>

Inheritance diagram for ControlUnit:
Inheritance graph

Public Member Functions

 ~ControlUnit ()
 
void add_unit (MeasurementUnit *unit)
 
bool has_electricity_demand () const
 Returns true if there is at least one connected measurement unit (MeasurementUnit) that shows a demand (positive consumption) in at least one time step.
 
bool has_pv () const
 Returns true, if the control unit has a PV attachted (in data or simulated).
 
bool has_bs () const
 Returns true, if the control unit has a battery storage system attachted (in data or simulated).
 
bool has_hp () const
 Returns true, if the control unit has a heat pump attachted (in data or simulated).
 
bool has_cs () const
 Returns true, if the unit has an EV charging station connected (in data or simulated)
 
bool has_chp () const
 Returns true, if the control unit has a combined heat and power (CHP) plant attachted (in data or simulated).
 
bool has_wind () const
 Returns true, if the control unit has a wind turbine (or many) attachted (in data or simulated).
 
bool has_bs_sim_added () const
 Returns true, if the control unit has a simulated battery storage system attachted.
 
bool is_expandable_with_pv ()
 Is a simulated PV installation addable (yes, if geodata is available). This function uses caching.
 
bool is_expandable_with_hp ()
 Is a simulated heat pump addable (yes, if geodata or gas consumption data is available). This function uses caching.
 
bool is_residential () const
 Is this unit a residential unit?
 
bool heat_demand_given_in_data () const
 Returns true, if the heat demand for this location is given in the input data.
 
int get_exp_combi_bit_repr () const
 Returns the bit representation of the current expansion (simulated added components) state (as in data plus simulated state). See also namespace expansion.
 
int get_exp_combi_bit_repr_from_MUs () const
 Returns the bit representation of the expansion of this unit as defined in the data. See also namespace expansion.
 
int get_exp_combi_bit_repr_sim_added () const
 Returns the bit representation of the expansion that has been simulatively added. See also namespace expansion.
 
double get_current_load_vSMeter_kW ()
 
double get_current_demand_wo_BS_or_gen_kW () const
 Returns the current local demand of all components excluding the BESS and also not considering the local generation from PV, wind, the BESS itselfe or the CHP.
 
double get_current_BS_demand_kW () const
 Returns the current BESS (charging) demand in kW.
 
double get_current_PV_generation_kW () const
 Returns the current local PV generation (regardless of self-consumption), always greater or equal to ControlUnit::get_current_PV_feedin_to_grid_kW()
 
double get_current_BS_generation_kW () const
 Returns the current local BS generation (regardless of self-consumption), always greater or equal to ControlUnit::get_current_PV_feedin_to_grid_kW()
 
double get_current_CHP_generation_kW () const
 Returns the current local CHP generation (regardless of self-consumption), always greater or equal to ControlUnit::get_current_PV_feedin_to_grid_kW()
 
double get_current_wind_generation_kW () const
 Returns the current local wind generation (regardless of self-consumption), always greater or equal to ControlUnit::get_current_PV_feedin_to_grid_kW()
 
double get_current_unknown_generation_kW () const
 Returns the current local generation that cannot be attributed to any generation technology (regardless of self-consumption), always greater or equal to ControlUnit::get_current_PV_feedin_to_grid_kW()
 
double get_current_PV_feedin_to_grid_kW () const
 Returns the current feed-in into the grid in kW that is generated by a PV installation.
 
double get_current_BS_feedin_to_grid_kW () const
 Returns the current feed-in into the grid in kW that is generated by a battery storage system.
 
double get_current_CHP_feedin_to_grid_kW () const
 Returns the current feed-in into the grid in kW that is generated by a CHP.
 
double get_current_wind_feedin_to_grid_kW () const
 Returns the current feed-in into the grid in kW that is generated by a wind turbine.
 
double get_current_unknown_feedin_to_grid_kW () const
 Returns the current feed-in into the grid in kW that is generated by unknown components or not attributable to any generation technology.
 
size_t get_n_MUs ()
 
size_t get_internal_id () const
 Returns the (consecutive) internal ID of the control unit.
 
size_t get_unitID () const
 returns the unit ID of this control unit as given in the system structure database
 
size_t get_location_id () const
 Returns the location ID of the control unit.
 
double get_mean_annual_MU_el_demand_kWh () const
 Returns the mean electricity demand in kWh of all connected MUs over all available years.
 
double get_sim_comp_pv_kWp () const
 Returns the kWp of the PV-component that is added for the simulation, returns 0 if there is no added PV component.
 
double get_sim_comp_bs_P_kW () const
 Returns the maximum power in kW of the battery storage component that is added for the simulation, returns 0 if there is no added battery. See also ComponentBS::get_maxP_kW().
 
double get_sim_comp_bs_E_kWh () const
 Returns the maximum capacity in kWh of the battery storage component that is added for the simulation, returns 0 if there is no added battery. See also ComponentBS::get_maxE_kWh().
 
float get_annual_heat_demand_th_kWh ()
 Returns the annual heat demand in (thermal) kWh of all attachted buildings.
 
float get_annual_hp_el_cons_kWh ()
 Returns the annual HP electricity consumption of a heat pump in kWh, if it would be added simulatively (regardless whether it is added or not)
 
double get_sim_comp_cs_max_P_kW () const
 Returns the maximum available charging power of the simulatively added charging station (if the station is enabled; otherwise it returns 0)
 
size_t get_sim_comp_cs_n_EVs () const
 Returns the number of connected EVs if the charging station component is enabled, otherwise 0 is returned.
 
size_t get_sim_comp_cs_possible_n_EVs () const
 Returns the number of EVs that would be connected to the charging station component, if it would be enablede.
 
double get_SSR ()
 Returns the SSR of the CU from the start of the simulation run until the time of function call; most usefull at the end of a simulation run.
 
double get_SCR ()
 Returns the SCR of the CU from the start of the simulation run until the time of function call; most usefull at the end of a simulation run.
 
double get_NPV ()
 Returns the net present value (NPV) of the CU from the start of the simulation run until the time of function call; most usefull at the end of a simulation run.
 
string * get_metrics_string_annual ()
 
string * get_metrics_string_weekly_wr (unsigned long week_number)
 
string * get_pv_section_string ()
 
const ComponentBSget_component_BS () const
 Returns a pointer to battery storage component, or nullptr if no such component is added.
 
const ComponentHPget_component_HP () const
 Returns a pointer to heat pump component, or nullptr if no such component is added.
 
const ComponentCSget_component_CS () const
 Returns a pointer to EV charging station component, or nullptr if no such component is added.
 
const ComponentPVget_component_PV () const
 Returns a pointer to PV component, or nullptr if no such component is added.
 
void add_exp_pv ()
 
void add_exp_bs ()
 Adds a simulated battery storage. Mind: MUST be called after ControlUnit::add_exp_hp() if it is called to ensure proper storage sizing for all configurations.
 
void add_exp_hp ()
 
void add_exp_cs ()
 Activates / enables the EV charging station at the control unit.
 
void add_ev (unsigned long carID)
 Adds an EV to the charging station (regardless if the charging station is enabled or not)
 
void preprocess_ev_data ()
 Preprocesses EV data, calls EVFSM::preprocessTourInformation() for all attached EVs. Call this method only once right before the first simulation run.
 
void set_output_object (CUOutput *output_obj)
 
void set_exp_pv_params_A (float kWp_static)
 Set the kWp of expanded PV installations in the case of static kWp computation per section.
 
void set_exp_pv_params_B (float kWp_per_m2, float min_kWp_sec, float max_kWp_sec, float max_kWp_unit)
 Set the kWp of expanded PV installations in the case of dynamic kWp computation per section.
 
void set_exp_bs_maxE_kWh (float value)
 
void set_exp_bs_maxP_kW (float value)
 
void set_exp_bs_E_P_ratio (float value)
 
void remove_sim_added_pv ()
 Removes a simulatively added PV installation.
 
void remove_sim_added_bs ()
 Removes a simulatively added battery storage.
 
void remove_sim_added_components ()
 Remove all components that are added simulatively.
 
void reset_internal_state ()
 Resets the internal state of the object, without removing added components.
 
bool compute_next_value (unsigned long ts)
 Computes the value for the (next) time step. The parameter 'ts' defines the current time step (starting counting at 1). This method must be called with strictly consecutive values ​​of parameter 'ts'.
 

Static Public Member Functions

static bool InstantiateNewControlUnit (unsigned long unitID, unsigned long substation_id, unsigned long locationID, bool residential, unsigned int n_flats)
 
static void InitializeStaticVariables (unsigned long n_CUs)
 
static void VacuumInstancesAndStaticVariables ()
 
static ControlUnitGetInstancePublicID (unsigned long unitID)
 Returns instance with a public unitID. Returns NULL, if unitID is out of the given range.
 
static ControlUnitGetInstancePublicIDWE (unsigned long unitID)
 Returns instance with a public unitID. Throws an error, if untiID is not defined.
 
static ControlUnitGetInstanceInternalID (unsigned long internalID)
 Returns the instance with a given internal ID without checking of the boundaries.
 
static const std::vector< ControlUnit * > & GetArrayOfInstances ()
 
static size_t GetNumberOfInstances ()
 
static size_t GetNumberOfCUsWithSimCompPV ()
 Returns the number of control units that hold a simulatively added PV installation.
 
static size_t GetNumberOfCUsWithSimCompHP ()
 Returns the number of control units that hold a simulatively added heat pump.
 
static size_t GetNumberOfCUsWithSimCompEV ()
 Returns the number of control units that hold a simulatively added (private) EV charging stations.
 
static double GetAllSimCompBatteriesCharge_kWh ()
 Returns the charge of all simulatively added battery storage systems at the current ts.
 
static double GetAllSimCompBatteriesCapacity_kWh ()
 Returns the capacity of all simulatively added battery storage systems.
 
static unsigned long GetTotalNumberOfOptimizationCalls ()
 Returns the total number of calls of an optimizer up to now.
 
static unsigned long GetCurrentNumberOfOptiVars ()
 Returns the current number of variables used in the currently running (parallel) optimizations. Only set if program option 'max-parallel-opti-vars' is set, i.e., Global::get_max_parallel_opti_vars() > 0.
 
static void PreprocessEVData ()
 Preprocesses EV data (min/max consumption until a given ts, states, ...) for all EVs.
 
static void ResetAllInternalStates ()
 
static void RemoveAllSimAddedComponents ()
 Removes all simulatively added components from all control units.
 
static void ChangeControlHorizonInTS (unsigned int new_horizon)
 Sets the optimization horizon (if another value is whished than given by Global::get_control_horizon_in_ts()). See also ControlUnit::change_control_horizon_in_ts().
 

Public Attributes

bool is_sim_expanded
 Puplicly accessible member, weather the control unit is expanded or not (required for SAC Planning). This flag has no internal effect inside the class.
 

Static Public Attributes

static const std::string MetricsStringHeaderAnnual = "UnitID,SCR,SSR,NPV,ALR,BDR,RBC,Sum of demand [kWh],Sum of MU demand [kWh],Sum of self-consumed e. [kWh],Sum of PV-generated e. [kWh],Sum of grid feed-in [kWh],Sum of grid demand [kWh],BS EFC,BS n_ts_empty,BS n_ts_full,BS total E withdrawn [kWh],BS total E withdrawn grid-originated [kWh],Sum of HP demand [kWh],Sum of CS demand [kWh],Peak grid demand [kW],Emissions cbgd [kg CO2eq],Avoided emissions [kg CO2eq],Actual electricity costs [CU],Electricity cons. costs [CU],Avoided electricity cons. costs [CU],Feed-in revenue [CU],Sim. PV max P [kWp],Sim. BS P [kW],Sim. BS E [kWh],n EVs,Sim. CS max P [kW],Simulated PV,Simulated BS,Simulated HP,Simulated CS,n errors in cntrl,n error cntrl cmd appl"
 The header for the output string produced by ControlUnit::get_metrics_string_annual()
 
static const std::string MetricsStringHeaderWeekly = "UnitID,Week number,SCR,SSR,Sum of demand [kWh],Sum of MU demand [kWh],Sum of self-consumed e. [kWh],Sum of PV-generated e. [kWh],Sum of grid feed-in [kWh],Sum of grid demand [kWh],BS EFC,BS total E withdrawn [kWh],BS total E withdrawn grid-originated [kWh],Sum of HP demand [kWh],Sum of CS demand [kWh],Peak grid demand [kW],Emissions cbgd [kg CO2eq],Avoided emissions [kg CO2eq],Actual electricity costs [CU],Electricity cons. costs [CU],Avoided electricity cons. costs [CU],Feed-in revenue [CU],Sim. PV max P [kWp],Sim. BS P [kW],Sim. BS E [kWh],n EVs,Sim. CS max P [kW],Simulated PV,Simulated BS,Simulated HP,Simulated CS,n errors in cntrl,n error cntrl cmd appl"
 The header for the output string produced by ControlUnit::get_metrics_string_weekly_wr()
 

Protected Member Functions

void change_control_horizon_in_ts (unsigned int new_horizon)
 Sets the optimization horizon (if another value is whished than given by Global::get_control_horizon_in_ts()). This is protected, as the default vector used for the optimization-based control stretegies must be updated, too.
 

Friends

class CUControllerWorkerThread
 

Detailed Description

This class represents a control unit (i.e. a private house or a small company). As the name suggests it is the place where a central control is located (if any, or a rulebased otherwise). All simulatively added components are added in this control unit. It holds a set (at least one) of measurement units.

Constructor & Destructor Documentation

◆ ~ControlUnit()

ControlUnit::~ControlUnit ( )

Member Function Documentation

◆ add_ev()

void ControlUnit::add_ev ( unsigned long  carID)

Adds an EV to the charging station (regardless if the charging station is enabled or not)

◆ add_exp_bs()

void ControlUnit::add_exp_bs ( )

Adds a simulated battery storage. Mind: MUST be called after ControlUnit::add_exp_hp() if it is called to ensure proper storage sizing for all configurations.

◆ add_exp_cs()

void ControlUnit::add_exp_cs ( )

Activates / enables the EV charging station at the control unit.

◆ add_exp_hp()

void ControlUnit::add_exp_hp ( )

◆ add_exp_pv()

void ControlUnit::add_exp_pv ( )

◆ add_unit()

void ControlUnit::add_unit ( MeasurementUnit unit)

◆ change_control_horizon_in_ts()

void ControlUnit::change_control_horizon_in_ts ( unsigned int  new_horizon)
protected

Sets the optimization horizon (if another value is whished than given by Global::get_control_horizon_in_ts()). This is protected, as the default vector used for the optimization-based control stretegies must be updated, too.

◆ ChangeControlHorizonInTS()

void ControlUnit::ChangeControlHorizonInTS ( unsigned int  new_horizon)
static

Sets the optimization horizon (if another value is whished than given by Global::get_control_horizon_in_ts()). See also ControlUnit::change_control_horizon_in_ts().

◆ compute_next_value()

bool ControlUnit::compute_next_value ( unsigned long  ts)

Computes the value for the (next) time step. The parameter 'ts' defines the current time step (starting counting at 1). This method must be called with strictly consecutive values ​​of parameter 'ts'.

◆ get_annual_heat_demand_th_kWh()

float ControlUnit::get_annual_heat_demand_th_kWh ( )

Returns the annual heat demand in (thermal) kWh of all attachted buildings.

◆ get_annual_hp_el_cons_kWh()

float ControlUnit::get_annual_hp_el_cons_kWh ( )

Returns the annual HP electricity consumption of a heat pump in kWh, if it would be added simulatively (regardless whether it is added or not)

◆ get_component_BS()

const ComponentBS * ControlUnit::get_component_BS ( ) const
inline

Returns a pointer to battery storage component, or nullptr if no such component is added.

◆ get_component_CS()

const ComponentCS * ControlUnit::get_component_CS ( ) const
inline

Returns a pointer to EV charging station component, or nullptr if no such component is added.

◆ get_component_HP()

const ComponentHP * ControlUnit::get_component_HP ( ) const
inline

Returns a pointer to heat pump component, or nullptr if no such component is added.

◆ get_component_PV()

const ComponentPV * ControlUnit::get_component_PV ( ) const
inline

Returns a pointer to PV component, or nullptr if no such component is added.

◆ get_current_BS_demand_kW()

double ControlUnit::get_current_BS_demand_kW ( ) const

Returns the current BESS (charging) demand in kW.

◆ get_current_BS_feedin_to_grid_kW()

double ControlUnit::get_current_BS_feedin_to_grid_kW ( ) const
inline

Returns the current feed-in into the grid in kW that is generated by a battery storage system.

◆ get_current_BS_generation_kW()

double ControlUnit::get_current_BS_generation_kW ( ) const

Returns the current local BS generation (regardless of self-consumption), always greater or equal to ControlUnit::get_current_PV_feedin_to_grid_kW()

◆ get_current_CHP_feedin_to_grid_kW()

double ControlUnit::get_current_CHP_feedin_to_grid_kW ( ) const
inline

Returns the current feed-in into the grid in kW that is generated by a CHP.

◆ get_current_CHP_generation_kW()

double ControlUnit::get_current_CHP_generation_kW ( ) const

Returns the current local CHP generation (regardless of self-consumption), always greater or equal to ControlUnit::get_current_PV_feedin_to_grid_kW()

◆ get_current_demand_wo_BS_or_gen_kW()

double ControlUnit::get_current_demand_wo_BS_or_gen_kW ( ) const
inline

Returns the current local demand of all components excluding the BESS and also not considering the local generation from PV, wind, the BESS itselfe or the CHP.

◆ get_current_load_vSMeter_kW()

double ControlUnit::get_current_load_vSMeter_kW ( )
inline

◆ get_current_PV_feedin_to_grid_kW()

double ControlUnit::get_current_PV_feedin_to_grid_kW ( ) const
inline

Returns the current feed-in into the grid in kW that is generated by a PV installation.

◆ get_current_PV_generation_kW()

double ControlUnit::get_current_PV_generation_kW ( ) const

Returns the current local PV generation (regardless of self-consumption), always greater or equal to ControlUnit::get_current_PV_feedin_to_grid_kW()

◆ get_current_unknown_feedin_to_grid_kW()

double ControlUnit::get_current_unknown_feedin_to_grid_kW ( ) const
inline

Returns the current feed-in into the grid in kW that is generated by unknown components or not attributable to any generation technology.

◆ get_current_unknown_generation_kW()

double ControlUnit::get_current_unknown_generation_kW ( ) const

Returns the current local generation that cannot be attributed to any generation technology (regardless of self-consumption), always greater or equal to ControlUnit::get_current_PV_feedin_to_grid_kW()

◆ get_current_wind_feedin_to_grid_kW()

double ControlUnit::get_current_wind_feedin_to_grid_kW ( ) const
inline

Returns the current feed-in into the grid in kW that is generated by a wind turbine.

◆ get_current_wind_generation_kW()

double ControlUnit::get_current_wind_generation_kW ( ) const

Returns the current local wind generation (regardless of self-consumption), always greater or equal to ControlUnit::get_current_PV_feedin_to_grid_kW()

◆ get_exp_combi_bit_repr()

int ControlUnit::get_exp_combi_bit_repr ( ) const

Returns the bit representation of the current expansion (simulated added components) state (as in data plus simulated state). See also namespace expansion.

◆ get_exp_combi_bit_repr_from_MUs()

int ControlUnit::get_exp_combi_bit_repr_from_MUs ( ) const

Returns the bit representation of the expansion of this unit as defined in the data. See also namespace expansion.

◆ get_exp_combi_bit_repr_sim_added()

int ControlUnit::get_exp_combi_bit_repr_sim_added ( ) const

Returns the bit representation of the expansion that has been simulatively added. See also namespace expansion.

◆ get_internal_id()

size_t ControlUnit::get_internal_id ( ) const
inline

Returns the (consecutive) internal ID of the control unit.

◆ get_location_id()

size_t ControlUnit::get_location_id ( ) const
inline

Returns the location ID of the control unit.

◆ get_mean_annual_MU_el_demand_kWh()

double ControlUnit::get_mean_annual_MU_el_demand_kWh ( ) const

Returns the mean electricity demand in kWh of all connected MUs over all available years.

◆ get_metrics_string_annual()

string * ControlUnit::get_metrics_string_annual ( )

◆ get_metrics_string_weekly_wr()

string * ControlUnit::get_metrics_string_weekly_wr ( unsigned long  week_number)

◆ get_n_MUs()

size_t ControlUnit::get_n_MUs ( )
inline

◆ get_NPV()

double ControlUnit::get_NPV ( )

Returns the net present value (NPV) of the CU from the start of the simulation run until the time of function call; most usefull at the end of a simulation run.

◆ get_pv_section_string()

string * ControlUnit::get_pv_section_string ( )

◆ get_SCR()

double ControlUnit::get_SCR ( )

Returns the SCR of the CU from the start of the simulation run until the time of function call; most usefull at the end of a simulation run.

◆ get_sim_comp_bs_E_kWh()

double ControlUnit::get_sim_comp_bs_E_kWh ( ) const

Returns the maximum capacity in kWh of the battery storage component that is added for the simulation, returns 0 if there is no added battery. See also ComponentBS::get_maxE_kWh().

◆ get_sim_comp_bs_P_kW()

double ControlUnit::get_sim_comp_bs_P_kW ( ) const

Returns the maximum power in kW of the battery storage component that is added for the simulation, returns 0 if there is no added battery. See also ComponentBS::get_maxP_kW().

◆ get_sim_comp_cs_max_P_kW()

double ControlUnit::get_sim_comp_cs_max_P_kW ( ) const

Returns the maximum available charging power of the simulatively added charging station (if the station is enabled; otherwise it returns 0)

◆ get_sim_comp_cs_n_EVs()

size_t ControlUnit::get_sim_comp_cs_n_EVs ( ) const

Returns the number of connected EVs if the charging station component is enabled, otherwise 0 is returned.

◆ get_sim_comp_cs_possible_n_EVs()

size_t ControlUnit::get_sim_comp_cs_possible_n_EVs ( ) const

Returns the number of EVs that would be connected to the charging station component, if it would be enablede.

◆ get_sim_comp_pv_kWp()

double ControlUnit::get_sim_comp_pv_kWp ( ) const

Returns the kWp of the PV-component that is added for the simulation, returns 0 if there is no added PV component.

◆ get_SSR()

double ControlUnit::get_SSR ( )

Returns the SSR of the CU from the start of the simulation run until the time of function call; most usefull at the end of a simulation run.

◆ get_unitID()

size_t ControlUnit::get_unitID ( ) const
inline

returns the unit ID of this control unit as given in the system structure database

◆ GetAllSimCompBatteriesCapacity_kWh()

double ControlUnit::GetAllSimCompBatteriesCapacity_kWh ( )
static

Returns the capacity of all simulatively added battery storage systems.

◆ GetAllSimCompBatteriesCharge_kWh()

double ControlUnit::GetAllSimCompBatteriesCharge_kWh ( )
static

Returns the charge of all simulatively added battery storage systems at the current ts.

◆ GetArrayOfInstances()

static const std::vector< ControlUnit * > & ControlUnit::GetArrayOfInstances ( )
inlinestatic

◆ GetCurrentNumberOfOptiVars()

static unsigned long ControlUnit::GetCurrentNumberOfOptiVars ( )
inlinestatic

Returns the current number of variables used in the currently running (parallel) optimizations. Only set if program option 'max-parallel-opti-vars' is set, i.e., Global::get_max_parallel_opti_vars() > 0.

◆ GetInstanceInternalID()

static ControlUnit * ControlUnit::GetInstanceInternalID ( unsigned long  internalID)
inlinestatic

Returns the instance with a given internal ID without checking of the boundaries.

◆ GetInstancePublicID()

ControlUnit * ControlUnit::GetInstancePublicID ( unsigned long  unitID)
static

Returns instance with a public unitID. Returns NULL, if unitID is out of the given range.

◆ GetInstancePublicIDWE()

ControlUnit * ControlUnit::GetInstancePublicIDWE ( unsigned long  unitID)
static

Returns instance with a public unitID. Throws an error, if untiID is not defined.

◆ GetNumberOfCUsWithSimCompEV()

size_t ControlUnit::GetNumberOfCUsWithSimCompEV ( )
static

Returns the number of control units that hold a simulatively added (private) EV charging stations.

◆ GetNumberOfCUsWithSimCompHP()

size_t ControlUnit::GetNumberOfCUsWithSimCompHP ( )
static

Returns the number of control units that hold a simulatively added heat pump.

◆ GetNumberOfCUsWithSimCompPV()

size_t ControlUnit::GetNumberOfCUsWithSimCompPV ( )
static

Returns the number of control units that hold a simulatively added PV installation.

◆ GetNumberOfInstances()

static size_t ControlUnit::GetNumberOfInstances ( )
inlinestatic

◆ GetTotalNumberOfOptimizationCalls()

static unsigned long ControlUnit::GetTotalNumberOfOptimizationCalls ( )
inlinestatic

Returns the total number of calls of an optimizer up to now.

◆ has_bs()

bool ControlUnit::has_bs ( ) const

Returns true, if the control unit has a battery storage system attachted (in data or simulated).

◆ has_bs_sim_added()

bool ControlUnit::has_bs_sim_added ( ) const

Returns true, if the control unit has a simulated battery storage system attachted.

◆ has_chp()

bool ControlUnit::has_chp ( ) const

Returns true, if the control unit has a combined heat and power (CHP) plant attachted (in data or simulated).

◆ has_cs()

bool ControlUnit::has_cs ( ) const

Returns true, if the unit has an EV charging station connected (in data or simulated)

◆ has_electricity_demand()

bool ControlUnit::has_electricity_demand ( ) const

Returns true if there is at least one connected measurement unit (MeasurementUnit) that shows a demand (positive consumption) in at least one time step.

◆ has_hp()

bool ControlUnit::has_hp ( ) const

Returns true, if the control unit has a heat pump attachted (in data or simulated).

◆ has_pv()

bool ControlUnit::has_pv ( ) const

Returns true, if the control unit has a PV attachted (in data or simulated).

◆ has_wind()

bool ControlUnit::has_wind ( ) const

Returns true, if the control unit has a wind turbine (or many) attachted (in data or simulated).

◆ heat_demand_given_in_data()

bool ControlUnit::heat_demand_given_in_data ( ) const

Returns true, if the heat demand for this location is given in the input data.

◆ InitializeStaticVariables()

void ControlUnit::InitializeStaticVariables ( unsigned long  n_CUs)
static

◆ InstantiateNewControlUnit()

bool ControlUnit::InstantiateNewControlUnit ( unsigned long  unitID,
unsigned long  substation_id,
unsigned long  locationID,
bool  residential,
unsigned int  n_flats 
)
static

Instantiates a new control unit. Returns false, if the unitID is already defined.

◆ is_expandable_with_hp()

bool ControlUnit::is_expandable_with_hp ( )

Is a simulated heat pump addable (yes, if geodata or gas consumption data is available). This function uses caching.

◆ is_expandable_with_pv()

bool ControlUnit::is_expandable_with_pv ( )

Is a simulated PV installation addable (yes, if geodata is available). This function uses caching.

◆ is_residential()

bool ControlUnit::is_residential ( ) const
inline

Is this unit a residential unit?

◆ preprocess_ev_data()

void ControlUnit::preprocess_ev_data ( )

Preprocesses EV data, calls EVFSM::preprocessTourInformation() for all attached EVs. Call this method only once right before the first simulation run.

◆ PreprocessEVData()

void ControlUnit::PreprocessEVData ( )
static

Preprocesses EV data (min/max consumption until a given ts, states, ...) for all EVs.

◆ remove_sim_added_bs()

void ControlUnit::remove_sim_added_bs ( )

Removes a simulatively added battery storage.

◆ remove_sim_added_components()

void ControlUnit::remove_sim_added_components ( )

Remove all components that are added simulatively.

◆ remove_sim_added_pv()

void ControlUnit::remove_sim_added_pv ( )

Removes a simulatively added PV installation.

◆ RemoveAllSimAddedComponents()

void ControlUnit::RemoveAllSimAddedComponents ( )
static

Removes all simulatively added components from all control units.

◆ reset_internal_state()

void ControlUnit::reset_internal_state ( )

Resets the internal state of the object, without removing added components.

◆ ResetAllInternalStates()

void ControlUnit::ResetAllInternalStates ( )
static

◆ set_exp_bs_E_P_ratio()

void ControlUnit::set_exp_bs_E_P_ratio ( float  value)

◆ set_exp_bs_maxE_kWh()

void ControlUnit::set_exp_bs_maxE_kWh ( float  value)

◆ set_exp_bs_maxP_kW()

void ControlUnit::set_exp_bs_maxP_kW ( float  value)

◆ set_exp_pv_params_A()

void ControlUnit::set_exp_pv_params_A ( float  kWp_static)

Set the kWp of expanded PV installations in the case of static kWp computation per section.

◆ set_exp_pv_params_B()

void ControlUnit::set_exp_pv_params_B ( float  kWp_per_m2,
float  min_kWp_sec,
float  max_kWp_sec,
float  max_kWp_unit 
)

Set the kWp of expanded PV installations in the case of dynamic kWp computation per section.

◆ set_output_object()

void ControlUnit::set_output_object ( CUOutput output_obj)

◆ VacuumInstancesAndStaticVariables()

void ControlUnit::VacuumInstancesAndStaticVariables ( )
static

Friends And Related Symbol Documentation

◆ CUControllerWorkerThread

friend class CUControllerWorkerThread
friend

Member Data Documentation

◆ is_sim_expanded

bool ControlUnit::is_sim_expanded

Puplicly accessible member, weather the control unit is expanded or not (required for SAC Planning). This flag has no internal effect inside the class.

◆ MetricsStringHeaderAnnual

const std::string ControlUnit::MetricsStringHeaderAnnual = "UnitID,SCR,SSR,NPV,ALR,BDR,RBC,Sum of demand [kWh],Sum of MU demand [kWh],Sum of self-consumed e. [kWh],Sum of PV-generated e. [kWh],Sum of grid feed-in [kWh],Sum of grid demand [kWh],BS EFC,BS n_ts_empty,BS n_ts_full,BS total E withdrawn [kWh],BS total E withdrawn grid-originated [kWh],Sum of HP demand [kWh],Sum of CS demand [kWh],Peak grid demand [kW],Emissions cbgd [kg CO2eq],Avoided emissions [kg CO2eq],Actual electricity costs [CU],Electricity cons. costs [CU],Avoided electricity cons. costs [CU],Feed-in revenue [CU],Sim. PV max P [kWp],Sim. BS P [kW],Sim. BS E [kWh],n EVs,Sim. CS max P [kW],Simulated PV,Simulated BS,Simulated HP,Simulated CS,n errors in cntrl,n error cntrl cmd appl"
static

The header for the output string produced by ControlUnit::get_metrics_string_annual()

◆ MetricsStringHeaderWeekly

const std::string ControlUnit::MetricsStringHeaderWeekly = "UnitID,Week number,SCR,SSR,Sum of demand [kWh],Sum of MU demand [kWh],Sum of self-consumed e. [kWh],Sum of PV-generated e. [kWh],Sum of grid feed-in [kWh],Sum of grid demand [kWh],BS EFC,BS total E withdrawn [kWh],BS total E withdrawn grid-originated [kWh],Sum of HP demand [kWh],Sum of CS demand [kWh],Peak grid demand [kW],Emissions cbgd [kg CO2eq],Avoided emissions [kg CO2eq],Actual electricity costs [CU],Electricity cons. costs [CU],Avoided electricity cons. costs [CU],Feed-in revenue [CU],Sim. PV max P [kWp],Sim. BS P [kW],Sim. BS E [kWh],n EVs,Sim. CS max P [kW],Simulated PV,Simulated BS,Simulated HP,Simulated CS,n errors in cntrl,n error cntrl cmd appl"
static

The header for the output string produced by ControlUnit::get_metrics_string_weekly_wr()


The documentation for this class was generated from the following files: