Explanation about the boundaries at the Particle Swarm Optimization
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Stefan Zeiter
el 18 de Mzo. de 2018
Comentada: Walter Roberson
el 19 de Mzo. de 2018
Hey.
I'm a freshman with the handling from Matlab and I have a question for the particle swarm optimization. Attached you can see my script for the PSO and the function (Rosenbrock function).
I have a question about VarMin and VarMax variables. These variables define the upper and lower bound. But when I define for example:
VarMin = 0
VarMax = 5
nVar = 5
Then of course I get for the GlobalBest a vector with 5 columns. For example:
Position: [3.7542e-04 -8.0293e-04 -0.0011 1.1266e-04 1.5088e-04]
How is this possible? There are negative values. And I defined the minimum boundary with zero.
I hope you can help me with my understanding problem.
Kind regards
0 comentarios
Respuesta aceptada
Walter Roberson
el 18 de Mzo. de 2018
The only place you use VarMin and VarMax is the line
particle(i).Position = unifrnd(VarMin, VarMax, VarSize);
to initialize the values.
However, as the particle moves, the velocity could easily have it go below VarMin or above VarMax, since you do not catch that it hits those boundaries.
You need to program in a test for hitting the boundaries, and you need to decide what you want to do with that case.
2 comentarios
Walter Roberson
el 19 de Mzo. de 2018
Correct, those variables currently only control starting positions.
Más respuestas (0)
Ver también
Categorías
Más información sobre Particle Swarm en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!