Documentation of UrbanFireXDT
Documentation of UrbanFireXDT
Loading...
Searching...
No Matches
Classes | Functions | Variables
output Namespace Reference

Classes

struct  CurrentParamValues
 

Functions

void initializeDirectoriesBase (unsigned long scenario_id)
 
void initializeDirectoriesPerPVar ()
 
void initializeSubstationOutput (unsigned long scenario_id)
 
void initializeCUOutput (unsigned long scenario_id)
 
void closeOutputs ()
 
void flushBuffers ()
 
void outputCurrentParamVariCombi (CurrentParamValues &)
 
void outputCurrentCUSettings ()
 This function outputs current settings of the control units (like PV kWp, BS capacity and power, ...) and also which roof sections exist per sim. added PV component.
 
void outputMetrics (bool alt_fname=false, string *fname_postfix=NULL)
 This function computed metrics for all control units after the simulation has been finished; if.
 
void outputMetricsStrListSACPlanning (list< string * > &output_list)
 
void outputWeeklyMetricsStrList (list< string * > *output_list, unsigned long week_number)
 
void outputEVMetrics (bool alt_fname=false, string *fname_postfix=NULL)
 
void outputRuntimeInformation (long seconds_setup, long seconds_main_run)
 
void outputControlCommandDetails (unsigned long ts, unsigned long cuID, bool optimization_state_ok, double inp_max_p_bs_kW, double inp_max_e_bs_kWh, double inp_max_p_cs_kW, double inp_current_bs_charge_kWh, const std::vector< float > &inp_future_resid_demand_kW, const std::vector< double > &inp_future_pv_generation_kW, const std::vector< double > &inp_future_hp_shiftable_maxP, const std::vector< double > &inp_future_hp_shiftable_minP, const std::vector< double > &inp_future_hp_shiftable_maxE, const std::vector< double > &inp_future_hp_shiftable_minE, const std::vector< const std::vector< double > * > *inp_future_ev_shiftable_maxE, const std::vector< const std::vector< double > * > *inp_future_ev_shiftable_minE, const std::vector< const std::vector< double > * > *inp_future_ev_maxP, const std::vector< double > &out_future_bs_power_kW, const std::vector< double > &out_future_hp_power_kW, const std::vector< std::vector< double > > &out_future_ev_power_kW)
 
void outputEVStateDetails (unsigned long ts, unsigned long carID, EVState ev_state, float p_charging_kW, float cumsum_E_ch_home, float cumsum_E_min, float cumsum_E_max, float ev_bs_SOE_kWh)
 

Variables

std::ofstream * substation_output = NULL
 The main file for the substation load time series.
 
std::ofstream * substation_output_details = NULL
 The secondary file for additional information about the substations.
 
std::ofstream * cu_details_ccmd_output = NULL
 Output file for command details per time step and control unit (if selected by –ccmd-output option)
 
std::ofstream * cu_details_ev_output = NULL
 Output file for ev details per time step and control unit (if selected by –ev-output option)
 
CUOutputSingleFilecu_single_output = NULL
 Reference to the single_output object, if one output for all CUs is selected.
 
CUOutputOneFilePerSubstation ** cu_multi_outputs = NULL
 Reference to the array of CU ouputs, if one output per CU is selected.
 
size_t n_cu_multi_outputs = 0
 Number of elements in cu_multi_ouputs.
 
std::mutex mtx_cu_details_ccmd
 Mutex to ensure proper working in parallel processing for output::cu_details_ccmd_output.
 
std::mutex mtx_cu_details_ev
 Mutex to ensure proper working in parallel processing for output::cu_details_ev_output.
 

Function Documentation

◆ closeOutputs()

void output::closeOutputs ( )

This function closes all outputs that are opend by initializeCUOutput() or initializeSubstationOutput(). It further informs all instances of the class ControlUnit that the output object is deleted.

◆ flushBuffers()

void output::flushBuffers ( )

This function flushes all buffers that are currently opend and were opened by initializeCUOutput() or initializeSubstationOutput().

◆ initializeCUOutput()

void output::initializeCUOutput ( unsigned long  scenario_id)

This method initializes the individual output files for the control units. Depending on the globally selected mode, one file per CU is created or some CUs share one output file. Moreover, it initializes the output files for the inidivudal control commands and the EV states per time step if selected by the command line arguments –ccmd-output and –ev-output.

Parameters
scenario_idThe current scenario ID

◆ initializeDirectoriesBase()

void output::initializeDirectoriesBase ( unsigned long  scenario_id)

This function initializes the base direcory (or directories) for the output, for the current scenario but not for individual parameter variations. It has to be called once (or multiple times if repetition is selected as cmd-line argument). It must be called before initializeDirectoriesPerPVar().

Parameters
scenario_idThe current scenario ID

◆ initializeDirectoriesPerPVar()

void output::initializeDirectoriesPerPVar ( )

This function initializes the direcory (or directories) for the current parameter variation (if selected). Thus, it has to be called for every parameter variation setting individually again. Even in the case of no parameter variation, it has to be called once. It MUST be called AFTER initializeDirectoriesBase().

◆ initializeSubstationOutput()

void output::initializeSubstationOutput ( unsigned long  scenario_id)

This method initializes the substation output file.

Parameters
scenario_idThe current scenario ID

◆ outputControlCommandDetails()

void output::outputControlCommandDetails ( unsigned long  ts,
unsigned long  cuID,
bool  optimization_state_ok,
double  inp_max_p_bs_kW,
double  inp_max_e_bs_kWh,
double  inp_max_p_cs_kW,
double  inp_current_bs_charge_kWh,
const std::vector< float > &  inp_future_resid_demand_kW,
const std::vector< double > &  inp_future_pv_generation_kW,
const std::vector< double > &  inp_future_hp_shiftable_maxP,
const std::vector< double > &  inp_future_hp_shiftable_minP,
const std::vector< double > &  inp_future_hp_shiftable_maxE,
const std::vector< double > &  inp_future_hp_shiftable_minE,
const std::vector< const std::vector< double > * > *  inp_future_ev_shiftable_maxE,
const std::vector< const std::vector< double > * > *  inp_future_ev_shiftable_minE,
const std::vector< const std::vector< double > * > *  inp_future_ev_maxP,
const std::vector< double > &  out_future_bs_power_kW,
const std::vector< double > &  out_future_hp_power_kW,
const std::vector< std::vector< double > > &  out_future_ev_power_kW 
)

Output the optimization input and output for one time step and control unit. Call this method only if Global::get_create_control_cmd_output() == true. This function is thread safe. All parameters starting with "inp_" are the input parameters for the optimization as defined in BaseOptimizedController::updateController(). All parameters starting with "out_" denote the output parameters returned by the controller / optimization.

◆ outputCurrentCUSettings()

void output::outputCurrentCUSettings ( )

This function outputs current settings of the control units (like PV kWp, BS capacity and power, ...) and also which roof sections exist per sim. added PV component.

◆ outputCurrentParamVariCombi()

void output::outputCurrentParamVariCombi ( CurrentParamValues cParamVals)

◆ outputEVMetrics()

void output::outputEVMetrics ( bool  alt_fname = false,
string *  fname_postfix = NULL 
)

Outputs the computed metrics for all simulated EVs after the simulation has been finished, similar to output::outputMetrics(). Creates an output file only, if there is at least one EV.

Parameters
alt_fnameif true, the output file will have the file name 'metrics-per-ev-{fname_postfix}.csv' instead of 'metrics-per-ev.csv'.
fname_postfixAlternative ending of the file name if required.

◆ outputEVStateDetails()

void output::outputEVStateDetails ( unsigned long  ts,
unsigned long  carID,
EVState  ev_state,
float  p_charging_kW,
float  cumsum_E_ch_home,
float  cumsum_E_min,
float  cumsum_E_max,
float  ev_bs_SOE_kWh 
)

Outputs information about one EV for a given time step. Call this function only if Global::get_create_ev_detailed_output() == true. This function is thread safe.

◆ outputMetrics()

void output::outputMetrics ( bool  alt_fname = false,
string *  fname_postfix = NULL 
)

This function computed metrics for all control units after the simulation has been finished; if.

Parameters
alt_fnameis set to true, the output file will have the file name 'metrics-{fname_postfix}.csv' instead of 'metrics-per-cu.csv'

◆ outputMetricsStrListSACPlanning()

void output::outputMetricsStrListSACPlanning ( list< string * > &  output_list)

Outputs every line that is collected in 'output_list' to 'metrics-sac-planning-per-cu.csv'. The output holds an additional last column about the added components for computing the metrics.

Parameters
output_listReference to the list containing each line as string (lines must not end with a new line)

◆ outputRuntimeInformation()

void output::outputRuntimeInformation ( long  seconds_setup,
long  seconds_main_run 
)

Output information on the run time to a file. Thus function must not be called before initializeDirectoriesBase().

Parameters
seconds_setupThe duration of the setup and data loading in seconds
seconds_main_runThe duration of the main run in seconds

◆ outputWeeklyMetricsStrList()

void output::outputWeeklyMetricsStrList ( list< string * > *  output_list,
unsigned long  week_number 
)

Outputs every line that is collected in 'output_list' to 'weekly-metrics-per-cu.csv'. Attention: This methods deletes the output list!

Parameters
output_listReference to the list containing each line as string (lines must not end with a new line)
week_numberThe week number of the output

Variable Documentation

◆ cu_details_ccmd_output

std::ofstream* output::cu_details_ccmd_output = NULL
inline

Output file for command details per time step and control unit (if selected by –ccmd-output option)

◆ cu_details_ev_output

std::ofstream* output::cu_details_ev_output = NULL
inline

Output file for ev details per time step and control unit (if selected by –ev-output option)

◆ cu_multi_outputs

CUOutputOneFilePerSubstation** output::cu_multi_outputs = NULL
inline

Reference to the array of CU ouputs, if one output per CU is selected.

◆ cu_single_output

CUOutputSingleFile* output::cu_single_output = NULL
inline

Reference to the single_output object, if one output for all CUs is selected.

◆ mtx_cu_details_ccmd

std::mutex output::mtx_cu_details_ccmd
inline

Mutex to ensure proper working in parallel processing for output::cu_details_ccmd_output.

◆ mtx_cu_details_ev

std::mutex output::mtx_cu_details_ev
inline

Mutex to ensure proper working in parallel processing for output::cu_details_ev_output.

◆ n_cu_multi_outputs

size_t output::n_cu_multi_outputs = 0
inline

Number of elements in cu_multi_ouputs.

◆ substation_output

std::ofstream* output::substation_output = NULL
inline

The main file for the substation load time series.

◆ substation_output_details

std::ofstream* output::substation_output_details = NULL
inline

The secondary file for additional information about the substations.