ljvmiranda921 / pyswarms

A research toolkit for particle swarm optimization in Python
https://pyswarms.readthedocs.io/en/latest/
MIT License
1.27k stars 333 forks source link

Optimizing using pre-defined options of positive integers #496

Open soso-maitha opened 2 years ago

soso-maitha commented 2 years ago

Hello, Thanks for this great library. I want to minimize an objective function that takes two parameters k and a. But the parameters values have to be from these predifned options which are k=[3,4,5,6,7,8,9,10], a=[500,1000,2000,3000,4000,5000,6000,7000]

The reason I am using PSO because some long operation needs to be done in between.

But PSO works with random floats. Is there any current option to round the paricles float values (after being initialize and recalcuated in each iteration) to positive integers that are in my predifned list of options. Or is there anyway I can put this restriction ?

Thanks and regards,