Algorithm components#

Steps and updates#

OMADS._poll._poll_step.poll_cycle(poll, options, param, state, stats, active_barrier, iteration, log, post, bb_handle, out, hashtable, ms=None)[source]#
Parameters:
OMADS._poll._poll_step.poll_step(poll, options, param, state, stats, active_barrier, iteration, frame_center, log, post, hashtable)[source]#

_summary_

Parameters:
  • poll (Dirs2n) – The poll step algorithm

  • options (Options) – The directions class object

  • param (Parameters) – Algorithmic options

  • state (MadsState) – Algorithmic parameters

  • stats (MadsStatistics) – Success status

  • active_barrier (BarrierMO) – Statistics and metadata class object

  • iteration (int) – The active barrier class object

  • xmin (CandidatePoint) – iteration number

  • log (logger) – current incumbent candidate

  • post (PostMADS) – updated log

  • frame_center (int)

  • hashtable (Cache)

Returns:

Updated incumbent candidate

Return type:

CandidatePoint

OMADS._search._search_step.search_cycle(search, options, param, state, stats, active_barrier, iteration, log, post, bb_handle, out, hashtable, search_vns=None, ms=None, model_search=False)[source]#
Parameters:
OMADS._search._search_step.search_step(search, options, param, state, stats, active_barrier, iteration, frame_center, log, post, hashtable, search_vns=None, model_search=False)[source]#

_summary_

Parameters:
  • poll (Dirs2n) – The poll step algorithm

  • options (Options) – The directions class object

  • param (Parameters) – Algorithmic options

  • state (MadsState) – Algorithmic parameters

  • stats (MadsStatistics) – Success status

  • active_barrier (BarrierMO) – Statistics and metadata class object

  • iteration (int) – The active barrier class object

  • xmin (CandidatePoint) – iteration number

  • log (logger) – current incumbent candidate

  • post (PostMADS) – updated log

  • search (EfficientExploration)

  • frame_center (int)

  • hashtable (Cache)

  • search_vns (VNS)

  • model_search (bool)

Returns:

Updated incumbent candidate

Return type:

CandidatePoint

OMADS._updates._updates.set_frame_centers_and_hvalues(state, active_barrier, param, options=None)[source]#

_summary_

Parameters:
  • state (MadsState) – _description_

  • active_barrier (BarrierMO) – _description_

  • param (Parameters) – _description_

  • options (Options)

OMADS._updates._updates.update(sampler, state, options, active_barrier, stats, hashtable=None)[source]#

Update step

Parameters:
OMADS._metrics._success.compute_success(active_barrier, state, options, insertion_flag, v)[source]#

_summary_

Parameters:
  • active_barrier (BarrierMO) – Evaluate success criteria and compute the success level

  • state (MadsState) – The active algorithm session state and metadata

  • options (Options) – algorithmic options

  • insertion_flag (str) – The update of non-dominated solutions or prim/sec incumbents

  • v (CandidatePoint)

Returns:

The success level

Return type:

SUCCESS_TYPES

Preprocessing#

class OMADS._pre._preprocess.preprocess(data={}, log=None, sampler_t=None)[source]#

Bases: object

Preprocessor for setting up optimization settings and parameters

Parameters:
  • data (Dict[Any, Any])

  • log (logger | None)

  • sampler_t (SAMPLER_TYPE)

sampler_preparation_and_initialization(param, x_start, is_xs, options, B, iteration, state, stats, ev, ms)[source]#

_summary_

Parameters:

Adaptive barrier#

class OMADS._barriers._barriers.AdaptiveBarrier(param, options, max_size=30000)[source]#

Bases: object

Parameters:

Poll directions#

class OMADS._directions._directions.Dirs2n[source]#

Bases: GenericSamplerBaseData, GenericSamplerBase

This is the orthognal 2n-directions class used for the poll step

Parameters:
  • _poll_dirs – Poll set (list of points)

  • _point_index – List of point indices

  • _n – Number of directions

  • _defined – A boolean that indicate if the poll points are defined

property bb_output: List[float]#

Evaluated blackbox functions

Returns:

List of evaluated blackbox functions

Return type:

List[float]

property frame_size#

Frame size getter

property candidate_points_set#

Candidates getter

generate_candidate_points()[source]#

Candidates generation abstract method

Returns:

_description_

Return type:

List[CandidatePoint]

postprocess_evaluated_candidates()[source]#

Postprocess and evaluate design criteria abstract method

update()[source]#

Update step abstract method

create_housholder(is_rich, domain=None, is_one_dir=False, n_plus_1=False)[source]#

Create householder matrix

Parameters:
  • is_rich (bool) – A flag that indicates if the rich direction option is enabled

  • domain (List[int])

  • is_one_dir (bool)

  • n_plus_1 (bool)

Returns:

The householder matrix

Return type:

np.ndarray

create_poll_set(ub, lb, fc, fci, it, var_type, var_sets, var_link, c_types=None, rich_direction=True, direction_type='ORTHO_2N')[source]#

Create the poll directions

Parameters:
  • hhm (np.ndarray) – Householder matrix

  • ub (List[float]) – Variables upper bound

  • lb (List[float]) – Variables lower bound

  • it (int) – iteration

  • fc (CandidatePoint)

  • fci (int)

  • var_type (List)

  • var_sets (Dict)

  • var_link (List[str])

  • c_types (List[BARRIER_TYPES])

  • rich_direction (bool)

  • direction_type (str)

scale(ub, lb, factor=10.0)[source]#

Scaling abstract method

Parameters:
  • ub (List[float]) – _description_

  • lb (List[float]) – _description_

  • factor (float, optional) – _description_, defaults to 10.0

gauss_perturbation(p, npts=5)[source]#

Gaussian perturbation abstract method

Parameters:
  • p (CandidatePoint) – _description_

  • npts (int, optional) – _description_, defaults to 5

Returns:

_description_

Return type:

List[CandidatePoint]

omit_duplicates(n_total_evals=0, stats=None, hashtable=None)[source]#

Omitting duplicate designs generated

Parameters:

Search samplers#

class OMADS._heuristics._exploration.EfficientExploration[source]#

Bases: GenericSamplerBaseData, GenericSamplerBase

Efficient exploration class

Parameters:

GenericSamplerBase (Class object) – Generic sampler base class

generate_quad_model_points(hashtable, fc, x_parent=None)[source]#

Cheap search, meant to run first every iteration (at most two evaluations):

  • speculative search: right after a success (x_parent is the point the incumbent was generated from), repeat that successful step once more from the incumbent;

  • quadratic model search (see _quad_model_point).

Single-objective only. With constraints (constraints_type set), the constraints are modelled too and the frame center may be infeasible (see _constrained_quad_model_point); otherwise the incumbent must be feasible. Leaves the candidate set empty when there is nothing worth evaluating.

Parameters:
generate_candidate_points()[source]#

Candidates generation abstract method

Returns:

_description_

Return type:

List[CandidatePoint]

postprocess_evaluated_candidates()[source]#

Postprocess and evaluate design criteria abstract method

update()[source]#

Update step abstract method

frame_size()[source]#

Frame size getter

property candidate_points_set#

Candidates getter

scale(ub, lb, factor=10.0)[source]#

Scaling abstract method

Parameters:
  • ub (List[float]) – _description_

  • lb (List[float]) – _description_

  • factor (float, optional) – _description_, defaults to 10.0

generate_sample_points(active_barrier, hashtable, ub, lb, fc, fci, it, var_type, var_sets, var_link, c_types=None, last_success=SUCCESS_TYPES.US, nsamples=None)[source]#

Generate the sample points

Parameters:
gauss_perturbation(p, npts=5)[source]#

Gaussian perturbation abstract method

Parameters:
  • p (CandidatePoint) – _description_

  • npts (int, optional) – _description_, defaults to 5

Returns:

_description_

Return type:

List[CandidatePoint]

omit_duplicates(n_total_evals=0, stats=None, hashtable=None)[source]#

Omitting duplicate designs generated

Parameters:
class OMADS._heuristics._exploration.VNS(stop=False, params=None, x_inc=None, seed=12345, rho=0.1)[source]#

Bases: VNSData

Parameters:
draw_from_gauss(mean)[source]#

_summary_

Parameters:

mean (CandidatePoint)

Return type:

List[CandidatePoint]

draw_from_gamma(mean)[source]#

_summary_

Parameters:

mean (CandidatePoint)

Return type:

List[CandidatePoint]

draw_from_exp(mean)[source]#

_summary_

Parameters:

mean (CandidatePoint)

Return type:

List[CandidatePoint]

draw_from_poisson(mean)[source]#

_summary_

Parameters:

mean (CandidatePoint)

Return type:

List[CandidatePoint]

draw_from_binomial(mean)[source]#

_summary_

Parameters:

mean (CandidatePoint)

Return type:

List[CandidatePoint]

generate_samples(active_barrier=None, dist=None)[source]#

_summary_

Parameters:
Return type:

List[float] | None

Meshes#

class OMADS._mesh._mesh.Mesh(pb_params, limit_min_mesh_index, limit_max_mesh_index)[source]#

Bases: ABC

Parameters:
  • pb_params (Parameters)

  • limit_min_mesh_index (int)

  • limit_max_mesh_index (int)

class OMADS._mesh._omesh.Omesh(pb_param, run_options)[source]#

Bases: Mesh

Mesh coarsness update class

Parameters:
  • _delta – mesh size

  • _Delta – poll size

  • _rho – poll size to mesh size ratio

  • _exp – manage the poll size granularity for discrete variables. See Audet et. al, The mesh adaptive direct search algorithm for granular and discrete variable

  • _mantissa – Same as _exp

  • psize_max – Maximum poll size

  • psize_success – Poll size at successful evaluation

  • _dtype – numpy double data type precision

  • pb_param (Parameters)

  • run_options (Options)

get_frame_size_parameter()[source]#

Get frame size parameter

class OMADS._mesh._gmesh.Gmesh(pb_param, run_options)[source]#

Bases: Mesh

GMesh: Granular mesh

Parameters:
get_frame_size_parameter()[source]#

Get frame size parameter

get_delta(i)[source]#

Access to the mesh size parameter delta^k. :param delta: The mesh size parameter delta^k – OUT. :param i: The index of the mesh size

Parameters:

i (int)

get_delta_frame(i)[source]#

Access to the poll size parameter Delta^k. :param Delta: The poll size parameter Delta^k – OUT. :param i: The index of the poll size

Parameters:

i (int)

init()[source]#

Initialization of granular poll size mantissa and exponent

enlarge_delta_frame_size(direction=None)[source]#

Enlarge the frame size based on the direction vector and anisotropy factor

Parameters:

direction (Point)

Return type:

bool

Templates#

class OMADS._templates._optimizer.GenericSamplerBase[source]#

Bases: ABC

Generic sampler class template

Parameters:
  • GenericSamplerBaseData (_type_) – _description_

  • Protocol (_type_) – _description_