CPSolver.ConstraintStore behaviour (Fixpoint v0.2.3)

Constraint store is a key-value store, where key is a variable id, and value is a implementation-dependent structure that allows to update and keep track of variables' domains.

Summary

Types

Link to this type

get_operation()

@type get_operation() :: CPSolver.Common.domain_get_operation() | nil
Link to this type

update_operation()

@type update_operation() :: CPSolver.Common.domain_update_operation()

Callbacks

Link to this callback

create(variables, opts)

@callback create(variables :: Enum.t(), opts :: Keyword.t()) ::
  {:ok, any()} | {:error, any()}
Link to this callback

dispose(store, variables)

@callback dispose(store :: any(), variables :: [CPSolver.Variable.t()]) ::
  :ok | :not_found
Link to this callback

domain(store, variable)

@callback domain(store :: any(), variable :: CPSolver.Variable.t()) ::
  {:ok, any()} | {:error, any()}
Link to this callback

get(store, variable, get_operation, list)

@callback get(store :: any(), variable :: CPSolver.Variable.t(), get_operation(), [any()]) ::
  {:ok, any()} | {:error, any()}
Link to this callback

get_variables(store)

@callback get_variables(store :: any()) :: [any()]
Link to this callback

on_change(variable, change)

@callback on_change(
  variable :: CPSolver.Variable.t(),
  change :: :fixed | :min_change | :max_change | :domain_change
) :: any()
Link to this callback

on_fail(variable)

@callback on_fail(variable :: CPSolver.Variable.t()) :: any()
Link to this callback

on_no_change(variable)

@callback on_no_change(variable :: CPSolver.Variable.t()) :: any()
Link to this callback

update(store, variable, update_operation, list)

@callback update(store :: any(), variable :: CPSolver.Variable.t(), update_operation(), [
  any()
]) :: any()
Link to this callback

update_domain(store, variable, update_operation, list)

@callback update_domain(
  store :: any(),
  variable :: CPSolver.Variable.t(),
  update_operation(),
  [any()]
) ::
  any()

Functions

Link to this function

create_store(store_impl, variables)

Link to this function

default_store()