gugarosa / opytimizer

🐦 Opytimizer is a Python library consisting of meta-heuristic optimization algorithms.
https://opytimizer.readthedocs.io
Apache License 2.0
599 stars 40 forks source link

[NEW] Using population data for population-based algorithms? #32

Closed jimmykimmy68 closed 1 year ago

jimmykimmy68 commented 1 year ago

Hello, First of all, thank you for sharing such a fantastic repo that can be used as an off-the-shelf meta-heuristic optimization algorithms!

I have a question regarding how to use my own population data for optimizers in optimizer. Rather than using SearchSpace that uses predetermined upper/lower bounds, is there any way I can use my own population samples to start the optimization from?

Thank you, hope you have a wonderful day!

gugarosa commented 1 year ago

Hello @jimmykimmy68! I hope everything is going well with you.

Thanks for the appreciation, I am glad to know that opytimizer is serving its purposes!

Regarding your question, I think you could inherit the Space class and change the _initialize_agents() method to load your agents instead of filling up them with uniform values. However, one thing that will always be needed are the lower and upper bounds for the decision variables, because they are somewhat used in other optimization-related classes, such as the Optimizer and its children (PSO, BA, etc).

Moreover, the Space or SearchSpace class are basically responsible for holding the agents, regardless of their structure. As long as you can fit your own population into the Agent structure, you should be good in making any modifications to the space itself.

Please let me know if you have any other questions!

Best regards, Gustavo.

jimmykimmy68 commented 1 year ago

Hello Mr. Gustavo,

First off, thank you so much for a fast, kind, and detailed reply! I do really appreciate it!

As you mentioned, I will try to follow your instruction and fit my own population data using the Agent structure.

Again, thank you so much for replying and of course, sharing a great library for practitioners!

Sincerely,

Gyeongho Kim

gugarosa commented 1 year ago

No problems! Please let me know if something comes up and we can draft together a way to solve it!

Best regards, Gustavo.