Questions tagged [particle-swarm]

In computer science, particle swarm optimization (PSO) is a computational method that optimizes a problem by iteratively trying to improve a candidate solution with regard to a given measure of quality.

In computer science, particle swarm optimization (PSO) is a computational method that optimizes a problem by iteratively trying to improve a candidate solution with regard to a given measure of quality.

Algorithm:

Initialize all agents;
while (not maximum iterations nor minimum error )
{
    foreach(agent in agents) 
     {
        Calculate function value at agent position;
        If (value < best_value_in_history)
            best_value_in_history= value;
    }

    current_best_value= calculate best value of all current agents positions;

    foreach(agent in agents)
    { 
         agent current_velocity =
             w * current_velocity + 
             p * random_double() * (current_best_value.position - current_position) + 
             g * random_double * (best_value_in_history.position - current_position);
         update_agent_position(current_velocity);
    }

}

where w,p,g are selected by the practitioner and control the behaviour and efficacy of the PSO method.

Third party implementations:

  • RRSI is a C# project to simulate particle swarm optimization on communicating robots.
  • SwarmOps C# and ANSI C codes for several optimization methods, including a few global best PSO variants.
  • Java Based PSO Framework part of the open-source project CIlib (Computational Intelligence Library).
  • PSO visualisation applet randomly generated particle swarm of 12 particles attempts to find the "global maximum" on the landscape.
175 questions
0
votes
1 answer

How to use Particle Swarm Optimization calling a function from a script

I want to use PSO in the following structure: lb = [-10,-15]; ub = [15,20]; options = optimoptions('particleswarm','SwarmSize',100,'HybridFcn',@fmincon); rng default % For reproducibility nvars = 2; x = particleswarm(fun,nvars,lb,ub) Where fun is…
JuanMuñoz
  • 165
  • 2
  • 11
0
votes
1 answer

Help Converting Math function into Code : Linear Kalman Particle Swarm Optimization

I'm trying to convert the math presented on this paper: http://www.bouncingchairs.net/pskalman-lategecco.pdf Around page 3 forward into working code. The algorithm itself is given around page 6, but I don't speak greek or math; so for the time being…
JWally
  • 582
  • 11
  • 18
0
votes
0 answers

How to use nature inspired algorithms like PSO as optimizers in keras model?

I am working on a keras model (Hierarchical attention network) to classify text into various categories. I have currently used Adam optimizer. I wish to use nature inspired algorithms like PSO, Cuckoo etc. as optimizers. The relevant code is as…
0
votes
1 answer

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…
Liam
  • 11
  • 2
0
votes
1 answer

How to define the objective fucntion's variables to be optimized in MATLAB's global optimization toolbox?

I have an objective function fun where the input parameter x should be optimized by particleswarm(): https://de.mathworks.com/help/gads/particleswarm.html I want to find the optimal values for x for defined scenarios. Because of this, besides x the…
MJQZ1347
  • 2,607
  • 7
  • 27
  • 49
0
votes
1 answer

applying the Particle swarm optimization algorithm into multi-dimentional searching space?

Can anyone help me to understand how to apply the PSO algorithm (Particle swarm optimization) for the optimization problem of a function in an N-dimensional searching space, for example, I have a function that has 7 parameters each varying in its…
R. Dana
  • 11
  • 3
0
votes
1 answer

Python: PSO clumping and code working only when mouse moves

I'm trying to make a simple PSO (particle-swarm optimization) program. Below is my current code, and I've been tweaking the weights only to find the "optimization" not working. import random as ran import math # import threading as thr import…
ChocolateOverflow
  • 460
  • 1
  • 4
  • 11
0
votes
1 answer

DEAP framework Python usage of "n=5" in PSO

What is the meaning of n in this code which is given as default in DEAP without an explanation in basic PSO? pop = toolbox.population(n=5) def main(): pop = toolbox.population(n=5) stats = tools.Statistics(lambda ind: ind.fitness.values) …
Tolga
  • 116
  • 2
  • 12
0
votes
0 answers

Stuck in local optima :minimization of Grienwank function in PSO

I am currently working on minimization of optimizing function in simple particle swarm optimization (PSO) using c++.First optimizing function (sphere) produced good results but the second function (Grienwank) stuck into local minim. Here is my…
0
votes
3 answers

Kalman Filtering need

I have a swarm robotic project. The localization system is done using ultrasonic and infrared transmitters/receivers. The accuracy is +-7 cm. I was able to do follow the leader algorithm. However, i was wondering why do i still have to use Kalman…
0
votes
0 answers

Particle Swarm Optimization Calling Counts

While trying to use the pso or hydroPSO package from R-CRAN, I have a need to use/access the counts (current iteration, current number function evaluation, and current restart) to work with the function I've been writing. However, I can't seem to…
Don
  • 170
  • 1
  • 11
0
votes
0 answers

integrate BP neural network with PSO

I would like to use PSO to optimize BP neural network weights for prediction of breast cancer on Matlab. there is no option in the neural toolbox to do that. and after searching, i found the memetic approach but I don't now how to use it throw…
0
votes
2 answers

Neural Network Training Using Particle Swarm Optimization

I want to train a feed forward neural network using Particle Swarm Optimization and Differential Evolution algorithms on Matlab, for prediction of breast cancer . I am new to Matlab so I search and found George Ever's toolbox but I don't know how to…
0
votes
1 answer

MATLAB: Invalid value for OPTIONS parameter InitialSwarmSpan

Using PSO in MATLAB, I follow the user manuals to set the options: options = optimoptions('particleswarm','SwarmSize',50,'InitialSwarmMatrix',[1.5,4.2,3.11,6.71]); Error using optimoptions (line 105) 'InitialSwarmMatrix' is not an option for…
ar2015
  • 5,558
  • 8
  • 53
  • 110
0
votes
0 answers

Count function fitness in binary particle swarm optimisation [BPSO]

I have BPSO with function1 and dont know how to count value. I know how to update velocity. And know values of vector x. x[i] = 0 or 1. Thanks I want to optimize function1. Single particle contains vectors: velocity[-Vmax,Vmax] and x[0 or 1]. First…
Tomasz Q
  • 1
  • 2