cocoex.utilities.ProblemNonAnytime(object)
class documentationcocoex.utilities
(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 | __init__ | Undocumented |
Method | __call__ | Undocumented |
Method | delivered | to be called with the solution returned by the solver. |
Method | reset | prepare the problem to be run on the next budget |
Method | free | Undocumented |
Method | print_progress | Undocumented |
Method | __enter__ | Undocumented |
Method | __exit__ | Undocumented |
Method | final_target_hit | Undocumented |
Method | best_observed_fvalue1 | Undocumented |
Method | random_solution | Undocumented |
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
.