pympcc.MultiStartResult¶
- class pympcc.MultiStartResult(best, runs=<factory>, failures=<factory>)[source]¶
Bases:
objectAggregate result of a multi-start solve.
- best¶
Result with the lowest objective among successful runs. Falls back to the lowest-objective run overall if every start failed (in which case
best.successisFalse).- Type:
- runs¶
All per-start results in start order. May be shorter than
n_startsif any starts raised an exception (those are recorded infailuresinstead).- Type:
list of MPCCResult
- failures¶
Tuples
(start_index, exception_type_name, message)for every start whosesolve()raised. Empty list when all starts completed (success or otherwise).
- The shortcut attributes ``x``, ``obj``, ``success``, ``comp_residual``
- proxy ``best`` so callers that don't care about diversity can use the
- object as a drop-in replacement for an :class:`MPCCResult`.
- __init__(best, runs=<factory>, failures=<factory>)¶
- Parameters:
best (MPCCResult)
runs (list[MPCCResult])
- Return type:
None
Methods
__init__(best[, runs, failures])unique_optima(*[, atol_obj, atol_x])Cluster successful runs by closeness in (obj, x).
Attributes
- best: MPCCResult¶
- runs: list[MPCCResult]¶
- unique_optima(*, atol_obj=1e-06, atol_x=0.0001)[source]¶
Cluster successful runs by closeness in (obj, x).
Two runs share a cluster when their objectives differ by less than
atol_objand their iterates agree withinatol_xin the infinity norm. The first run encountered in each cluster is returned, in start order.- Return type:
- Parameters: