SevgiAkten / pycellga

Cellular Genetic Algorithms in Python.
https://sevgiakten.github.io/pycellga/
MIT License
2 stars 1 forks source link

Test functions and the optimizer #38

Closed jbytecode closed 3 months ago

jbytecode commented 3 months ago

Summary for the commit (https://github.com/SevgiAkten/pycellga/commit/802342aa0fa0fe2a9312043ae59fade1a878c55c)

Test functions have no place in the optimizer

Optimizer is a problem agnostic object, that is, it should take the function subject to optimization, the min values for each single gene, the max values for each single gene, and the other optimization parameters such like operator types.

Thus, it's better to separate test functions and the optimization code.

Individual

The Individual is a problem agnostic object, it is only aware of the genome of the problem, e.g., binary, permutation, real, so it should not hold any problem information. Since it has a randomize() method, and if the optimization problem is real-valued, so we also need the min and max values of the genes in the chromosome.

jbytecode commented 3 months ago

The new commits solve this problem and feel free to close the issue when you finish reviewing the code and have no more questions.

SevgiAkten commented 3 months ago

Thank you, I’ve reviewed the code, and the updates resolve the issue. I’ll close it now.