From 4e157c99121f817e41f48d3a03966b0c6917ed9a Mon Sep 17 00:00:00 2001 From: "mhsatman@gmail.com" Date: Fri, 9 Aug 2024 21:40:03 +0300 Subject: [PATCH] update code comments in individual --- src/individual.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/individual.py b/src/individual.py index 5700e53..dc1ebae 100644 --- a/src/individual.py +++ b/src/individual.py @@ -56,6 +56,15 @@ def __init__(self, The minimum values for each gene in the chromosome. maxs: list[float] The maximum values for each gene in the chromosome. + + Description: + ------------ + The Individual class represents an individual in an evolutionary algorithm. + If the genome type is BINARY, the chromosome is a list of 0s and 1s. + If the genome type is PERMUTATION, the chromosome is a list of integers representing a permutation. + In both the binary and permutation cases, ch_size is enought to represent the chromosome. + If the genome type is REAL, the chromosome is a list of real numbers. + In this case, the mins and maxs lists are used to define the range of each gene in the chromosome. """ self.gen_type = gen_type self.ch_size = ch_size