From 7a10e3e78663ded85ab6fa6c44d7208ee92a0683 Mon Sep 17 00:00:00 2001 From: Mauricio Zambrano-Bigiarini <hzambran@users.noreply.github.com> Date: Wed, 7 Nov 2012 10:19:51 +0000 Subject: [PATCH] DESCRIPTION: hydroPSO now depends on R >= 2.13.0 (consistent with ByteCompile=TRUE) --- DESCRIPTION | 2 +- NEWS | 4 +++- R/PSO_v2012.R | 6 ++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 969e8f1..b9ee9f8 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -7,7 +7,7 @@ Authors@R: c(person("Mauricio", "Zambrano-Bigiarini", email="mzb.devel@gmail.com Maintainer: Mauricio Zambrano-Bigiarini <mzb.devel@gmail.com> Description: This package implements a state-of-the-art version of the Particle Swarm Optimisation (PSO) algorithm (SPSO-2011 and SPSO-2007 capable), with a special focus on the calibration of environmental models. hydroPSO is model-independent, allowing the user to easily interface any model code with the calibration engine (PSO). It includes a series of controlling options and PSO variants to fine-tune the performance of the calibration engine to different calibration problems. An advanced sensitivity analysis function together with user-friendly plotting summaries facilitate the interpretation and assessment of the calibration results. Bugs reports/comments/questions are very welcomed. License: GPL (>=2) -Depends: R (>= 2.10.0) +Depends: R (>= 2.13.0) Imports: Hmisc, sp, lattice, zoo, grid Suggests: hydroGOF(>= 0.3-5), hydroTSM(>= 0.3-6), zoo(>= 1.7-2), xts(>= 0.8-2), lhs, scatterplot3d, vioplot, multicore URL: http://www.rforge.net/hydroPSO, http://cran.r-project.org/web/packages/hydroPSO diff --git a/NEWS b/NEWS index d4d216d..5e13086 100755 --- a/NEWS +++ b/NEWS @@ -9,7 +9,7 @@ NEWS/ChangeLog for hydroPSO * optional normalisation of parameter values -) improved performance: ~ 33% faster for 32-bit machines and 38% faster for 64-bit machines. - Tested on 10-, 20- and 30-D benchmark functions with 'write2disk=FALSE'. + Tested on 10-, 20- and 30-D benchmark functions with 'write2disk=FALSE'. -) 'fn' argument now can be any R function or a character. In the latter case, it can be "hydromod" or the name of a valid R function. In previous versions of 'hydroPSO' only a character type was accepted. -) now it handles models with sub-daily time step and with sub-daily observations (thanks to O. Rakovec !). @@ -54,6 +54,8 @@ NEWS/ChangeLog for hydroPSO -) when the control argument 'out.with.fit.iter' (not used so far) is set to TRUE, the number of iterations returned correspond to the effective number of iterations carried out, not the maximum defined by 'maxit' -) now it is able to correctly write the observed values for sub-daily models + -) the package now depends on R >= 2.13.0, not 2.10.0 as in previous releases, in order to be consistent with the + byte-compiler setting of the package -) fixed some (very unlikely) error when 'IW.type="aiwf"' diff --git a/R/PSO_v2012.R b/R/PSO_v2012.R index 7514704..a008351 100755 --- a/R/PSO_v2012.R +++ b/R/PSO_v2012.R @@ -1159,6 +1159,11 @@ RegroupingSwarm <- function(x, # Making sure that the new range for each dimension is no larger than the original one Lnew <- pmin(Lmax, Lnew) + + message("Lmax:") + print(Lmax) + message("Lnew:") + print(Lnew) # Re-initializing particle's positions around gbest for (part in 1:npart) { @@ -1175,6 +1180,7 @@ RegroupingSwarm <- function(x, xmax <- gbest + 0.5*Lnew xMinMax <- cbind(xmin, xmax) + #x <- InitializateX(npart=npart, x.MinMax=x.Range, x.ini.type=xini.type) v <- InitializateV(npart=npart, x.MinMax=x.Range, v.ini.type=vini.type, Xini=x) #v <- InitializateV(npart=npart, x.MinMax=xMinMax, v.ini.type=vini.type, Xini=x) -- GitLab