gaft.components.individual¶
-
class
gaft.components.individual.DecretePrecision¶ Bases:
objectDescriptor for individual decrete precisions.
-
class
gaft.components.individual.IndividualBase(ranges, eps)¶ Bases:
objectBase class for individuals.
Parameters: - ranges (tuple list) – value ranges for all entries in solution.
- eps (float or float list (with the same length with ranges)) – decrete precisions for binary encoding, default is 0.001.
-
clone()¶ Clone a new individual from current one.
-
decode()¶ NEED IMPLIMENTATION
Convert chromsome sequence to solution.
Returns: The solution vector Return type: list of float
-
encode()¶ NEED IMPLIMENTATION
Convert solution to chromsome sequence.
Returns: The chromsome sequence Return type: list of float
-
init(chromsome=None, solution=None)¶ Initialize the individual by providing chromsome or solution.
Parameters: - chromsome (list of (float / int)) – chromesome sequence for the individual
- solution (list of float) – the variable vector of the target function.
Note
If both chromsome and solution are provided, only the chromsome would be used. If neither is provided, individual would be initialized randomly.