benchmark_problems

benchmark_problems

BenchmarkProblem

Bases: ABC

name abstractmethod classmethod

name() -> str

Return name of this benchmark problem.

description abstractmethod classmethod

description() -> str

Return single-line description of this benchmark problem.

supported_params abstractmethod classmethod

supported_params() -> dict[str, str]

Return a dictionary of supported parameters for this benchmark problem, as (param_name, param_description) key-value pairs in a dict.

get_example_parameters abstractmethod classmethod

get_example_parameters() -> dict[str, Any]

Return a dictionary of example acceptable parameter values for this benchmark problem, as (param_name, example_value) key-value pairs in a dict.

get_problem_dimensions abstractmethod classmethod

get_problem_dimensions(**kwargs) -> tuple[int, int, int, int, int]

Returns problem dimensions as (d, n, k, m, n_con_indices)-tuple for this benchmark problem, given the provided parameters. These dimensions can be indicative (especially n_con_indices), if they are stochastic. Main goal of this method is to get an idea of dimensions without needing to create the full problem instance.

Parameters:

Name Type Description Default
kwargs

parameters passed to create_problem_instance() for which we want to know resulting dimensions.

{}

create_problem_instance classmethod

create_problem_instance(**kwargs) -> MaxDivProblem

Create and return an instance of MaxDivProblem for this benchmark problem, using the provided parameters as needed.

BenchmarkProblemFactory

Factory class for conveniently constructing MaxDivProblem instances for benchmarking purposes.

This class makes all registered (and discovered) BenchmarkProblem subclasses available (see show_all) and allows creating corresponding MaxDivProblem instances by name & parameter values (see create_problem).

construct_problem classmethod

construct_problem(name: str, **params) -> MaxDivProblem

Create and return an instance of MaxDivProblem for the benchmark problem with the given name, using the provided parameters as needed.

get_problem_dimensions classmethod

get_problem_dimensions(name: str, **params) -> tuple[int, int, int, int, int]

Get problem dimensions as (d, n, k, m, n_con_indices)-tuple for the benchmark problem with the given name, using the provided parameters as needed.

show_all classmethod

show_all()

Show all registered benchmark problems and their parameters