releso.parser_environment.MultiProcessing

class releso.parser_environment.MultiProcessing(*, save_location: Path, logger_name: str | None = None, number_of_cores: ConstrainedIntValue = 1)

Bases: BaseModel

Define multiprocessing capability of environment.

Defines if the Problem should use Multiprocessing and with how many cores the solver can work. Does not force Multiprocessing for example if the solver does not support it.

__init__(**data: Any) None

Constructor for the ReLeSO basemodel object.

Methods

convert_to_pathlib_add_datetime(v)

Add timestamp to save_location, of applicable.

get_logger()

Gets the currently defined environment logger.

set_logger_name_recursively(logger_name)

Set the logger_name variable for all child elements.

Attributes

number_of_cores

Maximal number of cores which can be used by the current environment.

save_location

Definition of the save location of the logs and validation results.

logger_name

name of the logger.

number_of_cores: ConstrainedIntValue

Maximal number of cores which can be used by the current environment. Multi-Environments will use multiple of these.