Documentation of UrbanFireXDT
Documentation of UrbanFireXDT
Loading...
Searching...
No Matches
optimization_unit_general.hpp
Go to the documentation of this file.
1
8#ifndef OPTIMIZATION_UNIT_GENERAL_HPP
9#define OPTIMIZATION_UNIT_GENERAL_HPP
10
11#include <vector>
12
17 protected:
18 const unsigned long controlUnitID;
19 const unsigned long n_cars;
20 unsigned long time_horizon;
21 std::vector<double> bs_power;
22 std::vector<double> hp_power;
23 std::vector<std::vector<double>> ev_power;
26
27 public:
31 BaseOptimizedController(unsigned long cuID, unsigned int time_horizon, unsigned long n_cars) :
33 {
34 this->time_horizon = time_horizon;
35 ev_power.assign(n_cars, std::vector<double>(time_horizon, 0.0));
37 }
38
39 virtual ~BaseOptimizedController() = default;
40
45 const std::vector<double>& get_future_hp_power_kW() { return hp_power; }
46
51 const std::vector<double>& get_future_bs_power_kW() { return bs_power; }
52
57 const std::vector<std::vector<double>>& get_future_ev_power_kW() { return ev_power; }
58
63
68
72 void reset(unsigned int new_horizon) {
73 this->time_horizon = new_horizon;
74 bs_power.assign(new_horizon, 0.0);
75 hp_power.assign(new_horizon, 0.0);
76 ev_power.assign(this->n_cars, std::vector<double>(new_horizon, 0.0));
77 }
78
84 std::move(bs_power.begin() + 1, bs_power.end(), bs_power.begin());
85 bs_power.back() = 0.0;
86 std::move(hp_power.begin() + 1, hp_power.end(), hp_power.begin());
87 hp_power.back() = 0.0;
88 for (unsigned int evIdx = 0; evIdx < n_cars; evIdx++) {
89 std::move(ev_power[evIdx].begin() + 1, ev_power[evIdx].end(), ev_power[evIdx].begin());
90 ev_power[evIdx].back() = 0.0;
91 }
92 }
93
122 virtual bool updateController(
123 const unsigned long ts,
124 double max_p_bs_kW,
125 double max_e_bs_kWh,
126 double max_p_cs_kW,
127 double current_bs_charge_kWh,
128 const std::vector<float>& future_resid_demand_kW,
129 const std::vector<double>& future_pv_generation_kW,
130 const std::vector<double>& future_hp_shiftable_maxP,
131 const std::vector<double>& future_hp_shiftable_minP,
132 const std::vector<double>& future_hp_shiftable_maxE,
133 const std::vector<double>& future_hp_shiftable_minE,
134 const std::vector<const std::vector<double>*>* future_ev_shiftable_maxE,
135 const std::vector<const std::vector<double>*>* future_ev_shiftable_minE,
136 const std::vector<const std::vector<double>*>* future_ev_maxP,
137 const bool optimize_PV_size,
138 const bool optimize_BS_size,
139 const std::list<std::vector<double>>* total_PV_generation_per_section_kW,
140 const std::list<double>* max_PV_power_per_section_kWp
141 ) = 0;
142};
143
144#endif
145
Definition optimization_unit_general.hpp:16
const std::list< double > & get_optimal_PV_size_per_section_kW()
Definition optimization_unit_general.hpp:62
const std::vector< double > & get_future_bs_power_kW()
Definition optimization_unit_general.hpp:51
double get_optimal_BS_size_kWh()
Definition optimization_unit_general.hpp:67
unsigned long time_horizon
Definition optimization_unit_general.hpp:20
void shiftVectorsByOnePlace()
Definition optimization_unit_general.hpp:83
const unsigned long n_cars
Number of EVs with the given control unit as home place.
Definition optimization_unit_general.hpp:19
const std::vector< std::vector< double > > & get_future_ev_power_kW()
Definition optimization_unit_general.hpp:57
std::vector< std::vector< double > > ev_power
The charging power per EV (index 0) for every time step (index 1) in the time horizon.
Definition optimization_unit_general.hpp:23
BaseOptimizedController(unsigned long cuID, unsigned int time_horizon, unsigned long n_cars)
Definition optimization_unit_general.hpp:31
void reset(unsigned int new_horizon)
Definition optimization_unit_general.hpp:72
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.
Definition optimization_unit_general.hpp:24
std::vector< double > hp_power
The heat pump power for every time step in the time horizon.
Definition optimization_unit_general.hpp:22
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 me...
double optimal_bs_size_kWh
If the BS size should be optimized, this value contains the optimal BS size in kWh.
Definition optimization_unit_general.hpp:25
const std::vector< double > & get_future_hp_power_kW()
Definition optimization_unit_general.hpp:45
const unsigned long controlUnitID
ID of the connected control unit.
Definition optimization_unit_general.hpp:18
std::vector< double > bs_power
The battery storage power for every time step in the time horizon.
Definition optimization_unit_general.hpp:21
virtual ~BaseOptimizedController()=default