From 59df523afa540175baeff43c764f1b678c3e5093 Mon Sep 17 00:00:00 2001
From: Mauricio Zambrano-Bigiarini <hzambran@users.noreply.github.com>
Date: Fri, 15 Jun 2012 16:25:50 +0000
Subject: [PATCH] hydroPSO: default value of the inertia weight 'IW' was
 changed from (linearly decreasing) IW.w= c(1.2, 0.4) to 'IW.w=1/(2*log(2))'

---
 NEWS          | 1 +
 R/PSO_v2012.R | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index 8ffc02a..0f184b6 100755
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@ NEWS/ChangeLog for hydroPSO
         o 'hydroPSO'    : -) added '...' parameter. It is only used when 'fn' is different from "hydromod". This is only done for 'optim' compatibility.
                           -) fixed small bug related to improper PSO evolution when 'best.update'=="async" (NOT the default option !) 
                              AND (topology!="gbest" | method!="pso")
+                          -) default value of 'IW' was changed from (linearly decreasing) IW.w= c(1.2, 0.4) to 'IW.w=1/(2*log(2))'
                           -) source code was tidy up
                              
 0.1-56	14-Jun-2012
diff --git a/R/PSO_v2012.R b/R/PSO_v2012.R
index 5de6ac4..7011b45 100755
--- a/R/PSO_v2012.R
+++ b/R/PSO_v2012.R
@@ -1390,7 +1390,7 @@ hydroPSO <- function(
 	    boundary.wall=c("reflecting", "damping", "absorbing", "invisible"),
 	    topology=c("random", "gbest", "lbest", "vonNeumann"), K=3, iter.ini=0, ngbest=4, # only used when 'method=ipso'   
 
-	    use.IW = TRUE, IW.type=c("linear", "non-linear", "runif", "aiwf", "GLratio"), IW.w= c(1.2, 0.4), IW.exp= 1, 
+	    use.IW = TRUE, IW.type=c("linear", "non-linear", "runif", "aiwf", "GLratio"), IW.w=1/(2*log(2)), IW.exp= 1, 
 	    use.TVc1= FALSE, TVc1.type=c("non-linear", "linear", "GLratio"), TVc1.rng= c(2.2, 1.8), TVc1.exp= 1.5, 
 	    use.TVc2= FALSE, TVc2.type=c("non-linear", "linear"), TVc2.rng= c(1.8, 2.2), TVc2.exp= 1.5, 
 	    use.TVlambda=FALSE, TVlambda.type=c("non-linear", "linear"), TVlambda.rng= c(0.9, .1), TVlambda.exp= 1.7, 
-- 
GitLab