saealib.Variable#

class saealib.Variable[ソース]#

ベースクラス: 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)[ソース]#

Project x onto the valid domain.

パラメータ:

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

戻り値:

Repaired values, same shape as x.

戻り値の型:

np.ndarray