josiann.moves.base.Move

class josiann.moves.base.Move(*, bounds=None, repr_attributes=(), **kwargs)[source]

Base abstract class for defining how positions evolve in the SA algorithm.

Instantiate a Move.

Parameters:
  • bounds (Optional[ndarray[tuple[int, ...], dtype[float64 | int64]]] (default: None)) – optional sequence of (min, max) bounds for values to propose in each dimension.

  • repr_attributes (tuple[str, ...] (default: ())) – list of attribute names to include in the string representation of this Move.

  • kwargs (Any)

Methods

Move.__init__

Instantiate a Move.

Move.get_proposal

Generate a new proposed vector x.

Move.set_bounds

Set bounds for the move.

Methods

Move.__init__(*, bounds=None, repr_attributes=(), **kwargs)[source]

Instantiate a Move.

Parameters:
  • bounds (Optional[ndarray[tuple[int, ...], dtype[float64 | int64]]] (default: None)) – optional sequence of (min, max) bounds for values to propose in each dimension.

  • repr_attributes (tuple[str, ...] (default: ())) – list of attribute names to include in the string representation of this Move.

  • kwargs (Any)

Move.get_proposal(x, state)[source]

Generate a new proposed vector x.

Parameters:
Return type:

ndarray[tuple[int, ...], dtype[TypeVar(DT_ARR, bound= float64 | int64)]]

Returns:

New proposed vector x of shape (ndim,).

Move.set_bounds(bounds)[source]

Set bounds for the move.

Parameters:

bounds (tuple[float, float] | Sequence[tuple[float, float]] | None) – sequence of (min, max) bounds for values to propose in each dimension.

Return type:

None