Skip to content
Snippets Groups Projects
Commit 38925103 authored by Mauricio Zambrano-Bigiarini's avatar Mauricio Zambrano-Bigiarini
Browse files

'hydroPSO' function: fixed computation of velocity for 'method=canonical'

parent 902c558d
No related branches found
No related tags found
No related merge requests found
......@@ -252,7 +252,7 @@ compute.veloc <- function(x, v, w, c1, c2, CF, Pbest, part.index, gbest,
#vn <- CF * (w*v + gx + alea.sphere(G=gx + x, radius=enorm(gx) ) )
} else if ( method=="spso2007" ) {
} else if ( method %in% c("spso2007", "canonical") ) {
ifelse(part.index != localBest.pos,
vn <- CF * ( w*v + r1*c1*(pbest-x) + r2*c2*(localBest-x) ),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment