hzambran / hydroPSO

Model-Independent Particle Swarm Optimisation for Environmental Models
https://cran.r-project.org/package=hydroPSO
GNU General Public License v2.0
36 stars 18 forks source link

Error with methond == "wfips" #3

Closed russellpierce closed 8 years ago

russellpierce commented 9 years ago

The argument method="wfips" appears to not work or the documentation / error messages regarding missing parameters/misuse of the method are unclear. Consider:

temp <- function(x) {x[1]+x[2]}
hydroPSO(fn=temp, lower=c(1000,1000), upper=c(20000,20000), method="wfips") 

Which results in an error message that varies from run to run but fits the general pattern:

Error in is.data.frame(x) : 
  dims [product 2] do not match the length of object [40]

... where the number following product varies.

The code that triggers the error appears to be:

V[j, ] <- compute.veloc(x = X[j, ], v = V[j, ], w = w, c1 = c1, 
    c2 = c2, CF = CF, Pbest = X.best.part, part.index = j, gbest = X.best.part[gbest.pos, 
        ], topology = ltopology, method = method, MinMax = MinMax, 
    neighs.index = X.neighbours[j, ], localBest = X.best.part[LocalBest.pos[j], 
        ], localBest.pos = LocalBest.pos[j], ngbest.fit = ngbest.fit, 
    ngbest = X.best.part[ngbest.pos, ], lpbest.fit = pbest.fit[X.neighbours[j, 
        ]])
hzambran commented 8 years ago

Thanks @drknexus for reporting. The issue has been fixed in the current under-development release (v0.3-4-6). (I apologise for the big delay)

cjzilverberg commented 8 years ago

Thank you.


From: Mauricio Zambrano-Bigiarini notifications@github.com Sent: Monday, May 9, 2016 3:21:37 PM To: hzambran/hydroPSO Subject: Re: [hzambran/hydroPSO] Error with methond == "wfips" (#3)

Thanks for reporting. The issue has been fixed in the current under-development release (v0.3-4-6). (I apologise for the big delay)

You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHubhttps://github.com/hzambran/hydroPSO/issues/3#issuecomment-217977739

russellpierce commented 8 years ago

Thanks!