Closed jbytecode closed 4 months ago
The file https://github.com/SevgiAkten/pycell/blob/main/cga/optimizer.py includes an optimizer but there are still some issues:
I printed optimizer results and parameters in another way. Nevertheless, I researched pretty_printer(d: dict) to learn it. Thank you sir for sharing this information with me.
When you have a dict object in Python which is created like
>>> v = {"x": 3, "y": 10, "z": [1, 2, 3]}
then you are able to access its elements using string keys like
>>> v["x"]
3
>>> v["y"]
10
>>> v["z"]
[1, 2, 3]
so it is better to use compact key values rather than sentences.
So a key value Best Solution Chromosome :
is not a proper use.
of course, we should not use single character strings, a key value like pop_size
is okay, the point here is that the key values are like variable names
Now, it is time to implement an optimizer function. It will be necessary for the simulation suite.
The definition of the optimizer function should be in the form of
so we can optimize the OneMax by a simple call like
and the function may return a
Dict()
something like