简体   繁体   中英

Particle Swarm Optimisation with limited particle resolution

I'm working on a large power systems optimisation project in Python, where I'm optimising 6 system control parameters using particle swarm optimsation (PSO). I'm struggling to find a PSO package that can actually do what I need however. I'm currently using the 'pyswarm' package.

My problem has 6 control variables and it has constraints aside from the main objective function. The objective/fitness function is calculated in an external simulation, so every time that a new particle is tested, the sim program is opened, run, data exported then imported into Python. It's a ~16 second process for each swarm test, using a swarm size of 20. So with a typical 1000 iterations optimisation, that's 16,000 seconds to optimise, or 4.4 hours. I have 450 scenarios to optimise, which will take 82 days at the current rate. Obviously reducing the iterations will speed thigns up, but some scenarios will take a while to converge, so I'd like to keep the iterations high if possible.

All of the PSO implementations I've tried generate new particles as floats, with 6+ decimal point resolution. As I'm optimising for parameters in a physical system, I only really need results to 2 decimal places.

To speed up the optimisation, I want to use a PSO package where you can set the particle resolution, ie only try values with 2 decimal places. I figure this should make everything a lot faster, as the range of possible values is decreased hugely. I've used pyswarms, pyswarm, and psopy, but haven't found any package that can do this. Does anyone know how I could implement this? I'm not looking to write my own PSO implementation, just to use an existing package.

EDIT: To clarify, my logic is that currently, pyswarm produces float values for particles to a 6 decimal point resolution, so for a particle with a bound range of 20, there are 20 million possible values. If particle generation was limited to 2 decimal places, there would only be 2000 possible values for that same particle. Using a swarm size of 20, that means that in 100 iterations, every possible value for that particle would have been tested, so the solution would likely converge in well under 100 iterations (although this assumes unique values each time a particle is updated, which I don't believe is always the case).

Is this assumption correct, or is my logic here flawed?

To address your edit (Got a little long, thus not a comment), you don't just have, for instance, a range of 20 with 2000 possible values represented in that range. You have six control variables. Each control variable has some valid range over which you want to search, and your particle resolution can represent some number of possible values in that range.

Say each particle could represent 2000 different possible values for each control variable, that's 2000^6 or 6.4 * 10^19 (that's big) possible combinations of parameters for each particle to represent. I don't think you're likely to exhaustively search that whole range (see the last section).

All that is to say that your lower-resolution particles may not come to the perfect solution, but you probably won't be limited too much by particle resolution for the final performance. It's much more likely that you'll converge to some local minimum in such a large search space; I doubt the lost resolution per particle will matter too much.

Exhaustive search

Actually, big numbers are fun? How long would it take to search that whole parameter space, Let's say you were able to speed up your evaluation time by a factor of 1000. so it takes only.016 seconds to process each swarm. That's 20 guess per 0.016 seconds or 0.0008 seconds (800 us) per guess. That's still 5.12e16 seconds or 1.6 trillion years to exhaustively search the space.

Probably not a definitive source, but the remaining life of the Sun is only about 5 billion years, so you'll need to go faster if you want to exhaustively search before the death of the solar system.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM