diff --git a/R/PSO_v2012.R b/R/PSO_v2012.R index 0bbcc593b8be5f3622bd7a9416c8bdafd317ab4f..619ae7ffb941ae4101294b5298c110f3bca98365 100755 --- a/R/PSO_v2012.R +++ b/R/PSO_v2012.R @@ -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) ),