Documentation of UrbanFireXDT
Documentation of UrbanFireXDT
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
BaseOptimizedController Class Referenceabstract

#include <optimization_unit_general.hpp>

Inheritance diagram for BaseOptimizedController:
Inheritance graph

Public Member Functions

 BaseOptimizedController (unsigned long cuID, unsigned int time_horizon, unsigned long n_cars)
 
virtual ~BaseOptimizedController ()=default
 
const std::vector< double > & get_future_hp_power_kW ()
 
const std::vector< double > & get_future_bs_power_kW ()
 
const std::vector< std::vector< double > > & get_future_ev_power_kW ()
 
const std::list< double > & get_optimal_PV_size_per_section_kW ()
 
double get_optimal_BS_size_kWh ()
 
void reset (unsigned int new_horizon)
 
void shiftVectorsByOnePlace ()
 
virtual bool updateController (const unsigned long ts, double max_p_bs_kW, double max_e_bs_kWh, double max_p_cs_kW, double current_bs_charge_kWh, const std::vector< float > &future_resid_demand_kW, const std::vector< double > &future_pv_generation_kW, const std::vector< double > &future_hp_shiftable_maxP, const std::vector< double > &future_hp_shiftable_minP, const std::vector< double > &future_hp_shiftable_maxE, const std::vector< double > &future_hp_shiftable_minE, const std::vector< const std::vector< double > * > *future_ev_shiftable_maxE, const std::vector< const std::vector< double > * > *future_ev_shiftable_minE, const std::vector< const std::vector< double > * > *future_ev_maxP, const bool optimize_PV_size, const bool optimize_BS_size, const std::list< std::vector< double > > *total_PV_generation_per_section_kW, const std::list< double > *max_PV_power_per_section_kWp)=0
 Executes the controller with all (future) states in the current horizon and stores the results the member variables BaseOptimizedController::bs_power, BaseOptimizedController::hp_power and BaseOptimizedController::ev_power.
 

Protected Attributes

const unsigned long controlUnitID
 ID of the connected control unit.
 
const unsigned long n_cars
 Number of EVs with the given control unit as home place.
 
unsigned long time_horizon
 
std::vector< double > bs_power
 The battery storage power for every time step in the time horizon.
 
std::vector< double > hp_power
 The heat pump power for every time step in the time horizon.
 
std::vector< std::vector< double > > ev_power
 The charging power per EV (index 0) for every time step (index 1) in the time horizon.
 
std::list< double > optimal_pv_size_per_section_kW
 If the PV size should be optimized, this value contains the optimal PV size per section in kW.
 
double optimal_bs_size_kWh
 If the BS size should be optimized, this value contains the optimal BS size in kWh.
 

Detailed Description

optimization_unit_general.hpp

This file contains all general classes / structs required by the optimization implementations. This class represents the base class for an optimized (i.e., not rule-based) controller.

Constructor & Destructor Documentation

◆ BaseOptimizedController()

BaseOptimizedController::BaseOptimizedController ( unsigned long  cuID,
unsigned int  time_horizon,
unsigned long  n_cars 
)
inline

Constructs a new object with 0.0-initialized vectors with length of parameter time_horizon

◆ ~BaseOptimizedController()

virtual BaseOptimizedController::~BaseOptimizedController ( )
virtualdefault

Member Function Documentation

◆ get_future_bs_power_kW()

const std::vector< double > & BaseOptimizedController::get_future_bs_power_kW ( )
inline

Returns the optimized control for the battery storage for the next time steps in the time_horizon Attention: The returned object will be overwritten in future calls!

◆ get_future_ev_power_kW()

const std::vector< std::vector< double > > & BaseOptimizedController::get_future_ev_power_kW ( )
inline

Returns the optimized control for every EV for the next time steps in the time_horizon Attention: The returned object will be overwritten in future calls!

◆ get_future_hp_power_kW()

const std::vector< double > & BaseOptimizedController::get_future_hp_power_kW ( )
inline

Returns the optimized control for the heat pump for the next time steps in the time_horizon Attention: The returned object will be overwritten in future calls!

◆ get_optimal_BS_size_kWh()

double BaseOptimizedController::get_optimal_BS_size_kWh ( )
inline

Returns the optimal BS size in kWh if the BS size was also part of the optimization

◆ get_optimal_PV_size_per_section_kW()

const std::list< double > & BaseOptimizedController::get_optimal_PV_size_per_section_kW ( )
inline

Returns the optimal BS size in kWh if the BS size was also part of the optimization

◆ reset()

void BaseOptimizedController::reset ( unsigned int  new_horizon)
inline

Resets the vectors with 0.0-initialized values with length of parameter (new) parameter time_horizon

◆ shiftVectorsByOnePlace()

void BaseOptimizedController::shiftVectorsByOnePlace ( )
inline

Removes the first element, shifts the second one to the first place and so on and adds a 0.0 at the last place.

◆ updateController()

virtual bool BaseOptimizedController::updateController ( const unsigned long  ts,
double  max_p_bs_kW,
double  max_e_bs_kWh,
double  max_p_cs_kW,
double  current_bs_charge_kWh,
const std::vector< float > &  future_resid_demand_kW,
const std::vector< double > &  future_pv_generation_kW,
const std::vector< double > &  future_hp_shiftable_maxP,
const std::vector< double > &  future_hp_shiftable_minP,
const std::vector< double > &  future_hp_shiftable_maxE,
const std::vector< double > &  future_hp_shiftable_minE,
const std::vector< const std::vector< double > * > *  future_ev_shiftable_maxE,
const std::vector< const std::vector< double > * > *  future_ev_shiftable_minE,
const std::vector< const std::vector< double > * > *  future_ev_maxP,
const bool  optimize_PV_size,
const bool  optimize_BS_size,
const std::list< std::vector< double > > *  total_PV_generation_per_section_kW,
const std::list< double > *  max_PV_power_per_section_kWp 
)
pure virtual

Executes the controller with all (future) states in the current horizon and stores the results the member variables BaseOptimizedController::bs_power, BaseOptimizedController::hp_power and BaseOptimizedController::ev_power.

If parameter optimize_PV_size is set to true, the value of the parameter future_pv_generation_kW is ignored, and parameters total_PV_generation_per_section_kW and must be a valid reference. Otherwise, the last two parameters are ignored. If parameter optimize_BS_size is set to true, the value of max_e_bs_kWh and max_p_cs_kW are ignored. They are a result of the optimization. Moreover, in this case, current_bs_charge_kWh must be set to 0.0.

Parameters
tsThe current time step ID
max_p_bs_kWMaximum battery power in kW
max_e_bs_kWhBattery capacity in kWh
max_p_cs_kWMaximum charging station power in kW
current_bs_charge_kWhCurrent charge of the battery in kWh
future_resid_demand_kWVector with future residential energy demand in kW per time step in the horizon
future_pv_generation_kWVector with future PV generation power in kW per time step in the horizon
future_hp_shiftable_maxPVector with maximum power of the heat pump per time step
future_hp_shiftable_minPVector with minimum power of the heat pump per time step
future_hp_shiftable_maxEVector with maximum accumulated energy consumption of the heat pump in kWh until the end of each time step in the horizon
future_hp_shiftable_minEVector with minimum accumulated energy consumption of the heat pump in kWh until the end of each time step in the horizon
future_ev_shiftable_maxEVector with maximum accumulated energy consumption of the charging station in kWh for every step over the considered horizon (first index) and every EV (second index)
future_ev_shiftable_minEVector with minimum accumulated energy consumption of the charging station in kWh for every step over the considered horizon (first index) and every EV (second index)
future_ev_maxPVector with maximum charging power per EV in kW for every step over the considered horizon (first index) and every EV (second index)
optimize_PV_sizeFlag indicating if the PV size (per section) should be part of the optimization
optimize_BS_sizeFlag indicating if the BS size should be part of the optimization
total_PV_generation_per_section_kWTotal PV generation over the simulation horizon. Only required, if PV sizing (flag optimize_PV_size) is also a result of the optimization - otherwise, this parameter can be NULL
max_PV_power_per_section_kWpThe maximum installable power per roof section in kWp. Only required, if PV sizing (flag optimize_PV_size) is also a result of the optimization - otherwise, this parameter can be NULL
Returns
: Returns a boolean value, with true indicating if the optimization succeded, or false indicating an error (e.g., an unfeasable problem)

Implemented in GurobiLPController, ORToolsLPController, GurobiLPController, and ORToolsLPController.

Member Data Documentation

◆ bs_power

std::vector<double> BaseOptimizedController::bs_power
protected

The battery storage power for every time step in the time horizon.

◆ controlUnitID

const unsigned long BaseOptimizedController::controlUnitID
protected

ID of the connected control unit.

◆ ev_power

std::vector<std::vector<double> > BaseOptimizedController::ev_power
protected

The charging power per EV (index 0) for every time step (index 1) in the time horizon.

◆ hp_power

std::vector<double> BaseOptimizedController::hp_power
protected

The heat pump power for every time step in the time horizon.

◆ n_cars

const unsigned long BaseOptimizedController::n_cars
protected

Number of EVs with the given control unit as home place.

◆ optimal_bs_size_kWh

double BaseOptimizedController::optimal_bs_size_kWh
protected

If the BS size should be optimized, this value contains the optimal BS size in kWh.

◆ optimal_pv_size_per_section_kW

std::list<double> BaseOptimizedController::optimal_pv_size_per_section_kW
protected

If the PV size should be optimized, this value contains the optimal PV size per section in kW.

◆ time_horizon

unsigned long BaseOptimizedController::time_horizon
protected

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