Skip to content

Commit

Permalink
Merge pull request #52 from jbytecode/main
Browse files Browse the repository at this point in the history
update code comments in individual
  • Loading branch information
jbytecode authored Aug 9, 2024
2 parents 1d811c5 + 4e157c9 commit 0e35dee
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 0e35dee

Please sign in to comment.