Documentation of UrbanFireXDT
Documentation of UrbanFireXDT
Loading...
Searching...
No Matches
Functions
simulation Namespace Reference

Functions

bool oneStep (const unsigned long ts, const double totalBatteryCapacity_kWh, CUControllerThreadGroupManager *thread_manager=NULL, const char *output_prefix="", std::vector< ControlUnit * > *subsection=NULL)
 
bool runSimulationForOneParamSetting (CUControllerThreadGroupManager *thread_manager=NULL, std::vector< ControlUnit * > *subsection=NULL, const char *output_prefix="")
 
bool runSimulationForAllVariations (const unsigned long scenario_id, CUControllerThreadGroupManager *thread_manager=NULL)
 
bool runSimulationFAVsAndSAC (float expansion_matrix_rel_freq[16][16], unsigned long expansion_matrix_abs_freq[16][16], const unsigned long scenario_id)
 Runs the complete simulation for all parameter variations and add sim. added components to the CUs.
 
bool runCompleteSimulation (float expansion_matrix_rel_freq[16][16], unsigned long expansion_matrix_abs_freq[16][16], const unsigned long scenario_id)
 

Function Documentation

◆ oneStep()

bool simulation::oneStep ( const unsigned long  ts,
const double  totalBatteryCapacity_kWh,
CUControllerThreadGroupManager thread_manager = NULL,
const char *  output_prefix = "",
std::vector< ControlUnit * > *  subsection = NULL 
)

Runs one step of the simulation. Should only be called by simulation::runSimulationForOneParamSetting().

Attention: If a thread_manager is given, the subsection-argument is ignored! Thus, the thread manager must be initialized with the subsection!

Parameters
tscurrent time step (starting from 1)
totalBatteryCapacity_kWhTotal capacity over all batteries in kWh; required for computation of overall BS SOC
thread_managerIf multi-threading is active, an existing thread manager can be passed.
output_prefix(optional, default "") A prefix that should be added to the output file names
subsection(optional, default NULL) Execut the simulation for the current step only for a given sub-set of all known control units

◆ runCompleteSimulation()

bool simulation::runCompleteSimulation ( float  expansion_matrix_rel_freq[16][16],
unsigned long  expansion_matrix_abs_freq[16][16],
const unsigned long  scenario_id 
)

Run the complete simulation for a given scenario. If cmd-line argument 'repetitions' is set to a value higher 1, this function will handel this point. It will call runSimulationFAVsAndSAC(...). It also initializes the global output directory.

Parameters
expansion_matrix_rel_freqreference to the exp. matrix with relative values
expansion_matrix_abs_freqreference to the exp. matrix with absolute values
scenario_idscenario id to use
Returns
false, if an error occurs during simulation run or expansion planning, otherwise true

◆ runSimulationFAVsAndSAC()

bool simulation::runSimulationFAVsAndSAC ( float  expansion_matrix_rel_freq[16][16],
unsigned long  expansion_matrix_abs_freq[16][16],
const unsigned long  scenario_id 
)

Runs the complete simulation for all parameter variations and add sim. added components to the CUs.

This function is called by simulation::runSimulationFAVsAndSAC(). It starts the SAC (simulatively added components) planning and then run the simulation for all parameter variations (FAVs). It also initializes the thread group manager for the main run of the simulation (i.e., NOT for the SAC planning, this is done by the SAC planning function itselfe) if multi-processing is selected.

◆ runSimulationForAllVariations()

bool simulation::runSimulationForAllVariations ( const unsigned long  scenario_id,
CUControllerThreadGroupManager thread_manager = NULL 
)

Runs the simulation for all parameter variations. If no variations as selected, it will only call simulation::runSimulationForOneParamSetting() once. This function also handels the correct initialization of the output folders.

◆ runSimulationForOneParamSetting()

bool simulation::runSimulationForOneParamSetting ( CUControllerThreadGroupManager thread_manager = NULL,
std::vector< ControlUnit * > *  subsection = NULL,
const char *  output_prefix = "" 
)

Runs the simulation for the complete defined time span for one parameter setting and one repetition. It can be either called by simulation::runSimulationForAllVariations() or during the initialization phase for the SAC planning. This function creates a a thread manager object, if multi-threading is selected and no existing thread manager instance is passed.

Parameters
thread_managerIf multi-threading is active, an existing thread manager can be passed.
subsectionIf not NULL, the simulation is only executed for the given control units
output_prefixThe prefix for stdout information. If not empty, if changes the writing to stdout.