saealib.Variable#

class saealib.Variable[source]#

Bases: ABC

Abstract base for a single design variable.

Subclasses define the domain and how to project values back onto it. All bounds are expressed in the encoded float representation used by Population arrays.

Methods

__init__

repair

Project x onto the valid domain.

Method Details

Variable.__init__()#
abstractmethod Variable.repair(x)[source]#

Project x onto the valid domain.

Parameters:

x (np.ndarray) – Values for this dimension. Shape () (scalar) or (n,) (batch).

Returns:

Repaired values, same shape as x.

Return type:

np.ndarray