Skip to content

Commit

Permalink
update code comments in individual
Browse files Browse the repository at this point in the history
  • Loading branch information
jbytecode committed Aug 9, 2024
1 parent 92792a4 commit 4e157c9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/individual.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4e157c9

Please sign in to comment.