saealib.Individual

class saealib.Individual(population, index)[source]

Bases: Generic[T_Population]

Individual class representing a single solution in the population.

Parameters:
  • population (T_Population)

  • index (int)

_popref

Weak reference to the parent population.

Type:

weakref.ref

_index

Index of the individual in the population.

Type:

int

_structure_version

Version number to track structure modifications.

Type:

int

Methods

__init__

get_readonly_value

Retrieve the value of the specified key.

update_value

Update value in place and bump the value version.

Method Details

Individual.__init__(population, index)[source]
Parameters:
  • population (T_Population)

  • index (int)

Individual.get_readonly_value(key)[source]

Retrieve the value of the specified key.

If the value is a NumPy array, return a read-only view.

Parameters:

key (str)

Return type:

Any

Individual.update_value(key, value)[source]

Update value in place and bump the value version.

Parameters:
  • key (str)

  • value (Any)

Return type:

None