View Source CEM.Problem (cem v0.1.0)

Module defining a Problem struct.

Summary

Types

Function to draw a random instance from the probability distribution with the given parameters.

Function to initialize the parameters of the probability distribution used to generate candidate solutions.

Canidate solution.

Map of options used internally.

Parameters of the the probability distribution used to generate candidate solutions.

Function to score a candidate solution.

Score value of a candidate solution.

Function to smooth the parameters of the probability distribution by linearly interpolating between the most recent sample-based update and the parameters from the previous optimization iteration.

Iteration count for the CEM search.

t()

Function to decide if the search should be terminated based on the log so far. If not provided, the search will end when the n_step_max is reached (see docs for CEM.search/2).

Function to update the parameters of the probability distribution using a sample of candidate solutions.

Types

@type draw() :: (params() -> instance())

Function to draw a random instance from the probability distribution with the given parameters.

@type init() :: (opts() -> params())

Function to initialize the parameters of the probability distribution used to generate candidate solutions.

@type instance() :: any()

Canidate solution.

@type opts() :: map()

Map of options used internally.

@type params() :: any()

Parameters of the the probability distribution used to generate candidate solutions.

@type score() :: (instance() -> score_value())

Function to score a candidate solution.

@type score_value() :: float()

Score value of a candidate solution.

@type smooth() ::
  (params_new :: params(), params_prev :: params(), float() -> params())

Function to smooth the parameters of the probability distribution by linearly interpolating between the most recent sample-based update and the parameters from the previous optimization iteration.

@type step() :: non_neg_integer()

Iteration count for the CEM search.

@type t() :: %CEM.Problem{
  draw: draw(),
  init: init(),
  score: score(),
  smooth: smooth(),
  terminate?: terminate?() | nil,
  update: update()
}
@type terminate?() :: (Log.t(), opts() -> boolean())

Function to decide if the search should be terminated based on the log so far. If not provided, the search will end when the n_step_max is reached (see docs for CEM.search/2).

@type update() :: ([instance()] -> params())

Function to update the parameters of the probability distribution using a sample of candidate solutions.

Functions

@spec new(keyword()) :: t()
Link to this function

replace(problem, fun_name, fun)

View Source
@spec replace(t(), atom(), (... -> any())) :: t()