Problem¶
Class for defining problem.
Problem
¶
Problem(
model,
weather_input,
/,
model_inputs=(),
outputs=(),
*,
evaluation_dir=None,
has_templates=False,
noise_sample_kwargs=None,
clean_patterns=_OutputManager._DEFAULT_CLEAN_PATTERNS,
removes_subdirs=False,
)
Define a parametrics/optimisation problem.
| PARAMETER | DESCRIPTION | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
model
|
Model file path.
TYPE:
|
|||||||||||||||
weather_input
|
Weather input variable.
TYPE:
|
|||||||||||||||
model_inputs
|
Model input variables.
TYPE:
|
|||||||||||||||
outputs
|
Output variables.
TYPE:
|
|||||||||||||||
evaluation_dir
|
Evaluation directory path, default is a directory named 'evaluation' in the same folder as the model file.
TYPE:
|
|||||||||||||||
has_templates
|
Whether the model has HVAC templates.
TYPE:
|
|||||||||||||||
noise_sample_kwargs
|
Settings for sampling uncertain variables, including
TYPE:
|
|||||||||||||||
clean_patterns
|
Patterns to clean simulation files.
This is ignored if
TYPE:
|
|||||||||||||||
removes_subdirs
|
Whether to remove the subdirectories in the evaluation directory.
TYPE:
|
run_random
¶
run_random(size, /, *, mode='auto', seed=None)
Run parametrics via a random sample.
| PARAMETER | DESCRIPTION |
|---|---|
size
|
Sample size.
TYPE:
|
mode
|
Sampling mode.
TYPE:
|
seed
|
Random seed.
TYPE:
|
run_latin_hypercube
¶
run_latin_hypercube(size, /, *, seed=None)
Run parametrics via a latin hypercube sample.
| PARAMETER | DESCRIPTION |
|---|---|
size
|
Sample size.
TYPE:
|
seed
|
Random seed.
TYPE:
|
run_nsga2
¶
run_nsga2(
population_size,
termination,
/,
*,
p_crossover=1.0,
p_mutation=0.2,
init_population_size=0,
saves_history=True,
checkpoint_interval=0,
seed=None,
)
Run optimisation via the NSGA2 algorithm.
| PARAMETER | DESCRIPTION |
|---|---|
population_size
|
Population size.
TYPE:
|
termination
|
Termination criterion, see https://pymoo.org/interface/termination.html.
TYPE:
|
p_crossover
|
Crossover probability.
TYPE:
|
p_mutation
|
Mutation probability.
TYPE:
|
init_population_size
|
Initial population size. This allows setting a different (usually larger)
population size for the first generation. Any non-positive value falls back
to the value of
TYPE:
|
saves_history
|
Whether to save the iteration history, see https://pymoo.org/interface/minimize.html.
TYPE:
|
checkpoint_interval
|
Frequency of saving a checkpoint. Any non-positive value disables the checkpoint function.
TYPE:
|
seed
|
Random seed.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Result
|
Pymoo result object, see https://pymoo.org/interface/result.html. |
run_nsga3
¶
run_nsga3(
population_size,
termination,
/,
reference_directions=None,
*,
p_crossover=1.0,
p_mutation=0.2,
init_population_size=0,
saves_history=True,
checkpoint_interval=0,
seed=None,
)
Run optimisation via the NSGA3 algorithm.
| PARAMETER | DESCRIPTION |
|---|---|
population_size
|
Population size.
TYPE:
|
termination
|
Termination criterion, see https://pymoo.org/interface/termination.html.
TYPE:
|
reference_directions
|
Reference directions, see https://pymoo.org/misc/reference_directions.html. The Riesz s-Energy method is used to generate reference directions as per the input count and the population size.
TYPE:
|
p_crossover
|
Crossover probability.
TYPE:
|
p_mutation
|
Mutation probability.
TYPE:
|
init_population_size
|
Initial population size. This allows setting a different (usually larger)
population size for the first generation. Any non-positive value falls back
to the value of
TYPE:
|
saves_history
|
Whether to save the iteration history, see https://pymoo.org/interface/minimize.html.
TYPE:
|
checkpoint_interval
|
Frequency of saving a checkpoint. Any non-positive value disables the checkpoint function.
TYPE:
|
seed
|
Random seed.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Result
|
Pymoo result object, see https://pymoo.org/interface/result.html. |
resume
staticmethod
¶
resume(checkpoint_file, /, *, termination=None, checkpoint_interval=0)
Resume optimisation using a checkpoint.
| PARAMETER | DESCRIPTION |
|---|---|
checkpoint_file
|
Checkpoint file path.
TYPE:
|
termination
|
Termination criterion. The one in the checkpoint will be reused if not specified.
TYPE:
|
checkpoint_interval
|
Frequency of saving a checkpoint. Any non-positive value disables the checkpoint function.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Result
|
Pymoo result object, see https://pymoo.org/interface/result.html. |