opensbt.problem package

Submodules

opensbt.problem.adas_problem module

class opensbt.problem.adas_problem.ADASProblem(xl: List[float], xu: List[float], scenario_path: str, fitness_function: Fitness, simulate_function, critical_function: Critical, simulation_variables: List[str], simulation_time: float = 10, sampling_time: float = 100, design_names: List[str] | None = None, objective_names: List[str] | None = None, problem_name: str | None = None, other_parameters: Dict | None = None, approx_eval_time: float | None = None, do_visualize: bool = False)[source]

Bases: SimulationProblem

Basic problem class for ADAS problems

__init__(xl: List[float], xu: List[float], scenario_path: str, fitness_function: Fitness, simulate_function, critical_function: Critical, simulation_variables: List[str], simulation_time: float = 10, sampling_time: float = 100, design_names: List[str] | None = None, objective_names: List[str] | None = None, problem_name: str | None = None, other_parameters: Dict | None = None, approx_eval_time: float | None = None, do_visualize: bool = False)[source]

Generates a simulation-based testing problem.

Parameters:
  • xl (List[float]) – Lower bound for the search domain.

  • xu (List[float]) – Upper bound for the search domain.

  • scenario_path (str) – The path to the scenario to be simulated.

  • fitness_function (Fitness) – The instance of the fitness function to evaluate simulations.

  • simulate_function (_type_) – The pointer to the simulate function of the simulator.

  • critical_function (Critical) – The instance of the oracle function to assign pass fail verdicts.

  • simulation_variables (List[float]) – The name of the simulation variables to alter for test generation.

  • simulation_time (float, optional) – The simulation time for the test execution, defaults to 10

  • sampling_time (float, optional) – The sampling time for the simulator, defaults to 100

  • design_names (List[str], optional) – The name for the search variable to use in the output. If none is said, simulation_variables is used, defaults to None

  • objective_names (List[str], optional) – The name of the objectives to use in the output, defaults to None

  • problem_name (str, optional) – The name of the problem, defaults to None

  • other_parameters (Dict, optional) – Other necessary parameters, defaults to None

  • approx_eval_time (float, optional) – The approximate evaluation time for one test execution, defaults to None

  • do_visualize (bool, optional) – Visualize test execution or not, defaults to False

Raises:

ValueError – Raises ValueError if min_or_max of fitness function is not correctly configured.

_evaluate(x, out, *args, **kwargs)[source]
is_simulation()[source]

opensbt.problem.pymoo_test_problem module

class opensbt.problem.pymoo_test_problem.PymooTestProblem(problem_name: str, critical_function: Critical, approx_eval_time: float = 0.01)[source]

Bases: SimulationProblem

Problem class to test testing algorithms on mathematical problems implemented in pymoo.

__init__(problem_name: str, critical_function: Critical, approx_eval_time: float = 0.01)[source]

Instantiates a pymoo based problem with name “problem_name” as testing problem.

_calc_pareto_front()[source]
_calc_pareto_set()[source]
_evaluate(X, out, *args, **kwargs)[source]
_instantiate_from_given_problem(problem)[source]
approx_sim_time()[source]
is_simulation()[source]

Module contents