Skip to content

Output

Classes for defining outputs.

RVICollector

RVICollector(
    ep_output_names,
    ep_output_type,
    filename,
    /,
    ep_output_keys=(),
    ep_output_frequency="",
    *,
    objectives=(),
    constraints=(),
    objective_direction="minimise",
    constraint_bounds=(-math.inf, 0),
    is_final=True,
)

Collects outputs by RVI.

This collector retrieves EnergyPlus simulation results defined by either Output:Variable or Output:Meter via the ReadVarsESO programme, the required RVI file is auto-generated.

PARAMETER DESCRIPTION
ep_output_names

EnergyPlus output names.

TYPE: str or iterable of str

ep_output_type

EnergyPlus output type.

TYPE: ('variable', 'meter') DEFAULT: 'variable'

filename

Output filename, this must end with .csv.

TYPE: str

ep_output_keys

Specific names for EnergyPlus variable outputs, only applicable when ep_output_type is set to variable.

TYPE: str or iterable of str DEFAULT: ()

ep_output_frequency

EnergyPlus output frequency.

TYPE: str DEFAULT: ''

objectives

Optimisation objectives, which must match the output names in the output file.

TYPE: str or iterable of str DEFAULT: ()

constraints

Optimisation constraints, which must match the output names in the output file.

TYPE: str or iterable of str DEFAULT: ()

objective_direction

Optimisation objective direction.

TYPE: ('minimise', 'maximise') DEFAULT: 'minimise'

constraint_bounds

Optimisation constraint bounds.

TYPE: tuple of float DEFAULT: `(-math.inf, 0)`

is_final

Whether the output is final and recorded.

TYPE: bool DEFAULT: `True`

ScriptCollector

ScriptCollector(
    script_file,
    script_language,
    filename,
    /,
    script_kwargs=None,
    *,
    level="task",
    objectives=(),
    constraints=(),
    objective_direction="minimise",
    constraint_bounds=(-math.inf, 0),
    is_final=True,
)

Collects outputs by script.

This collector computes user-defined outputs by calling user-provided scripts, which can be used for either the task- or the job-level output collection. The task level usually deals with building performance metrics, whilst the job level can calculate robustness measures. A loads_kwargs method is provided to conveniently retrieve useful output-related data inside scripts.

Currently only a Python script is supported.

PARAMETER DESCRIPTION
script_file

Script file path.

TYPE: str or path-like object

script_language

Script language, whose executable path must be configured via config_script.

TYPE: 'python' DEFAULT: 'python'

filename

Output filename.

TYPE: str

script_kwargs

Additional keyword arguments passed into the script.

TYPE: dict DEFAULT: None

level

Output collection level.

TYPE: ('task', 'job') DEFAULT: 'task'

objectives

Optimisation objectives, which must match the output names in the output file.

TYPE: str or iterable of str DEFAULT: ()

constraints

Optimisation constraints, which must match the output names in the output file.

TYPE: str or iterable of str DEFAULT: ()

objective_direction

Optimisation objective direction.

TYPE: ('minimise', 'maximise') DEFAULT: 'minimise'

constraint_bounds

Optimisation constraint bounds.

TYPE: tuple of float DEFAULT: `(-math.inf, 0)`

is_final

Whether the output is final and recorded.

TYPE: bool DEFAULT: `True`

loads_kwargs staticmethod

loads_kwargs()

Retrieve keyword arguments in scripts.

RETURNS DESCRIPTION
dict

Keys of this dictionary are 'cwd', 'filename', 'objectives', 'constraints', in addition to any key in script_kwargs. If level is set to 'task', the current working directory is the task directory in which this script is executed, otherwise it is the job directory.