saealib.IntegerVariable#

class saealib.IntegerVariable(lb, ub)[source]#

Bases: Variable

Integer-valued variable on [lb, ub] (both inclusive).

Stored as float64 in population arrays; rounded by repair().

Parameters:
  • lb (int) – Lower and upper bounds (inclusive).

  • ub (int) – Lower and upper bounds (inclusive).

Methods

__init__

repair

Round x to the nearest integer and clip to [lb, ub].

Method Details

IntegerVariable.__init__(lb, ub)[source]#
Parameters:
  • lb (int)

  • ub (int)

Return type:

None

IntegerVariable.repair(x)[source]#

Round x to the nearest integer and clip to [lb, ub].

Parameters:

x (np.ndarray) – Values for this dimension.

Returns:

Rounded and clipped values.

Return type:

np.ndarray