class documentation

class ProblemNonAnytime:

Constructor: ProblemNonAnytime(suite, observer, index)

View In Hierarchy

The non-anytime problem class.

Serves to benchmark a "budgeted" algorithm whose behavior decisively depends on a budget input parameter.

Usage:

# given: suite and observer instances, budget_list, fmin
for index in range(len(suite)):
    with ProblemNonAnytime(suite, observer, index) as problem:
        x0 = problem.initial_solution  # or whatever fmin needs as input
        for budget in sorted(budget_list):
            x = fmin(problem, x0, budget)  # minimize
            problem.delivered(x)  # prepares for next budget also
            if problem.final_target_hit:
                break

Details: This class maintains two problems - one observed and the other unobserved. It switches from unobserved to observed when p_unobserved.evaluations >= p_observed.evaluations.

Method __call__ Undocumented
Method __enter__ Undocumented
Method __exit__ Undocumented
Method __init__ Undocumented
Method delivered to be called with the solution returned by the solver.
Method free Undocumented
Method print_progress Undocumented
Method reset prepare the problem to be run on the next budget
Class Variable inherited_constant_attributes Undocumented
Instance Variable evaluations Undocumented
Instance Variable p_observed Undocumented
Instance Variable p_unobserved Undocumented
Instance Variable suite Undocumented
Property best_observed_fvalue1 Undocumented
Property final_target_hit Undocumented
Property random_solution Undocumented
Instance Variable _number_of_delivery_evaluations Undocumented
Instance Variable _p Undocumented
def __call__(self, x, *args, **kwargs):

Undocumented

def __enter__(self):

Undocumented

def __exit__(self, *args):

Undocumented

def __init__(self, suite, observer, index):

Undocumented

def delivered(self, x, *args, **kwargs):

to be called with the solution returned by the solver.

The method records the delivered solution (if necessary) and prepares the problem to be run on the next budget by calling reset.

def free(self):

Undocumented

def print_progress(self):

Undocumented

def reset(self):

prepare the problem to be run on the next budget

inherited_constant_attributes: list[str] =

Undocumented

evaluations: int =

Undocumented

p_observed =

Undocumented

p_unobserved =

Undocumented

suite =

Undocumented

@property
best_observed_fvalue1 =

Undocumented

@property
final_target_hit =

Undocumented

@property
random_solution =

Undocumented

_number_of_delivery_evaluations: int =

Undocumented

_p =

Undocumented