panobbgo.core.StrategyBase#

class panobbgo.core.StrategyBase(problem, parse_args=False, testing_mode=False, **kwargs)[source]#

This abstract BaseStrategy is the parent class of all Strategies.

Use it this way:

  1. Subclass it, write your optional initializer, afterwards call the initializer of this class (it will start its the main loop).

  2. Overwrite the execute(), which returns a list of new search points (by requesting them from the heuristics via the get_points() method) and might also emit Events.

This execute method will be called repeatedly as long as there are less than the given maximum number of search points evaluated.

@type problem: panobbgo.lib.Problem @param problem: @param parse_args: @param testing_mode: @param kwargs: Additional configuration parameters (e.g. max_eval, max_evaluations)

__init__(problem, parse_args=False, testing_mode=False, **kwargs)[source]#

@type problem: panobbgo.lib.Problem @param problem: @param parse_args: @param testing_mode: @param kwargs: Additional configuration parameters (e.g. max_eval, max_evaluations)

Methods

__init__(problem[, parse_args, testing_mode])

@type problem: panobbgo.lib.Problem @param problem: @param parse_args: @param testing_mode: @param kwargs: Additional configuration parameters (e.g. max_eval, max_evaluations).

add(Heur, **kwargs)

add_analyzer(a)

Add an analyzer to the strategy.

add_heuristic(h)

Add a heuristic to the strategy.

analyzer(who)

check_dependencies()

This method is called in self.start() (and only there) for checking all the dependencies of all modules.

execute()

Overwrite this method when you extend this base strategy.

heuristic(who)

Look up a heuristic by its who tag.

info()

init_module(module)

StrategyBase calls this method.

on_converged(reason, stats)

Called when the Convergence analyzer detects convergence.

start()

validate_setup()

Validate that the framework is properly set up before starting optimization.

Attributes

PROBLEM_KEY

analyzers

avg_time_per_task

average walltime per finished task, NaN before the first one.

best

evaluators

Compatibility property for legacy code that references evaluators.

heuristics

name

time_cpu

effective cpu time in seconds

time_start_str

time_wall

wall time in seconds