Optimization

this doc gives an overview over the optimization phases.

Phase I

TODO

Phase II

class cobraPhaseII.CobraPhaseII(cobra: CobraInitializer)

SACOBRA phase II executor.

Information is communicated via object CobraInitializer cobra (with elements sac_opts and sac_res) and via object Phase2Vars p2 (internal variables needed in phase II).

get_cobra()
Returns:

COBRA variables

Return type:

CobraInitializer

get_p2()
Returns:

phase II variables

Return type:

Phase2Vars

start()

Start the main optimization loop of phase II

Perform in a loop, until the budget feval is exhausted:

  • select cyclically an element p2.ro from DRC XI

  • train RBF surrogate models on the current set of infill points

  • select start point xStart: either current-best xbest or random start (see RandomStarter)

  • perform sequential optimization, starting from xStart. Result is xNew = p2.opt_res['x']

  • evaluate xNew on the real functions + do refine step (if EQU.active). Result is the updated EvaluatorReal object p2.ev1

  • calculate p-effect for onlinePLOG

  • update cobra information (A, Fres, Gres and others)

  • update and save cobra: data frames df, df2, elements sac_res['xbest', 'fbest', 'ibest']

  • adjust margins p2.EPS, \(\mu\) (see EQUoptions), adjust \(\rho\) (see RBFoptions) and Cfeas, Cinfeas

The result is a modified object cobra (detailed diagnostic info in cobra.df, cobra.df2) and the optimization results can be retrieved from cobra with methods get_fbest(), get_xbest() and get_xbest_cobra().

Returns:

self

class phase2Vars.Phase2Vars(cobra: CobraInitializer)

This class is just a container for variables needed by CobraPhaseII (in addition to CobraInitializer cobra). These variables include:

  • EPS number, the current safety margin EPS in constraint surrogates

  • currentMu number, the current equality margin \(\mu\), see equHandling.py

  • num the number of real function evaluations carried out

  • globalOptCounter counter of the global optimization steps in phase II, excluding repair and trust region

  • Cfeas how many feasible infills in a row (see adjustMargins, updateInfoAndCounters)

  • Cinfeas how many infeasible infills in a row (see adjustMargins, updateInfoAndCounters)

  • fitnessSurrogate the objective surrogate model

  • constraintSurrogates the constraint surrogate models

Example: p2 = Phase2Vars; print(p2.num);