From a9a34cea6a762a73fcfaf2e55cb2854cb15adfff Mon Sep 17 00:00:00 2001
From: Mauricio Zambrano-Bigiarini <hzambran@users.noreply.github.com>
Date: Mon, 17 Sep 2012 22:10:47 +0000
Subject: [PATCH] updated NEWS. updated 'hydroPSO.Rd', with fixed documentation
 regarding c1 and c2

---
 NEWS            | 3 +++
 R/PSO_v2012.R   | 9 +++++----
 man/hydroPSO.Rd | 4 ++--
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/NEWS b/NEWS
index 6b2c909..f3c9c48 100755
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,9 @@ NEWS/ChangeLog for hydroPSO
                                Default ? (so far, SPSO 2011)
                             -) argument 'Vini.type'. The old values 'random' and 'lhs' were replaced by 'random2007' and 'lhs2007', in order to make 
                                clear that the follow the equation described in SPSO 2007.
+                            -) argument 'npart', when missing its value depends on the value of the 'method' argument:
+                               method == 'spso2007' => npart=10+2*[sqrt(n)] 
+                               method != 'spso2007' => npart=40
         
 0.1-58	14-Sep-2012
         o 'hydroPSO'      : -) 'random.update' is now ONLY used when 'best.update="async". In hydroPSO 0.1-57 'random.update' was set to TRUE 
diff --git a/R/PSO_v2012.R b/R/PSO_v2012.R
index 55cfe18..3346f46 100755
--- a/R/PSO_v2012.R
+++ b/R/PSO_v2012.R
@@ -841,7 +841,7 @@ InitializateV <- function(npart, param.IDs, x.MinMax, v.ini.type, Xini) {
     } else if ( v.ini.type=="zero" ) {
         V <- matrix(0, ncol=n, nrow=npart, byrow=TRUE)    
       } else if ( v.ini.type=="random2011" ) {
-          V <- Random.Bounded.Matrix(npart, (x.MinMax - cbind(Xini, Xini) ) 
+          V <- Random.Bounded.Matrix(npart, (x.MinMax - cbind(Xini, Xini) ) ) 
         } else if ( v.ini.type=="lhs2011" ) {
             V <- rLHS(npart, x.MinMax - cbind(Xini, Xini) )
           } 
@@ -1160,7 +1160,8 @@ hydromod.eval <- function(part, Particles, iter, npart, maxit,
 #          May-2011    ; 28-Oct-2011 ; 14-Nov-2011 ; 23-Nov-2011 ;             #
 #          15-Jan-2012 ; 23-Jan-2012 ; 30-Jan-2012 ; 23-Feb-2012 ; 23-Mar-2012 #
 #          14-Jun-2012 ; 15-Jun-2012 ; 03-Jul-2012 ; 06-Jul-2012               #
-#          11-Jul-2012 ; 17-Jul-2012 ; 18-Jul-2012 ; 13-Sep-2012; 14-Sep-2012  #                         
+#          11-Jul-2012 ; 17-Jul-2012 ; 18-Jul-2012 ; 13-Sep-2012; 14-Sep-2012  #
+#          17-Sep-2012 ;                                                       #                          
 ################################################################################
 # 'lower'           : minimum possible value for each parameter
 # 'upper'           : maximum possible value for each parameter
@@ -1174,10 +1175,10 @@ hydromod.eval <- function(part, Particles, iter, npart, maxit,
 #                     Must be divisible by 5 (requirement for the chaotic part)
 # 'maxit'           : numeric, with the maximum number of iterations
 # 'c1'              : numeric, representing the cognition constant. 
-#                     Encourages the exploration of the solution space.
+#                     Encourages the exploitation of the solution space.
 #                     How much the particle is influenced by the memory of his best location
 # 'c2'              : numeric, representing the social constant. 
-#                     Encourages the exploitation of the current global best
+#                     Encourages the exploration of the current global best
 #                     How much the particle is influenced by the rest of the swarm	
 # 'use.CF'          : logical, indicating if the Clerc's Constriction Factor have to be used
 #                     to ensure the convergence of the PSO algorithm
diff --git a/man/hydroPSO.Rd b/man/hydroPSO.Rd
index ce0d998..a08b2f5 100755
--- a/man/hydroPSO.Rd
+++ b/man/hydroPSO.Rd
@@ -100,10 +100,10 @@ numeric, maximum number of iterations
 numeric, maximum number of function evaluations. Default value is \code{+Inf}
 }
   \item{c1}{
-numeric, cognitive acceleration coefficient. Encourages the exploration of the solution space and reflects how much the particle is influenced by its own best-known position
+numeric, cognitive acceleration coefficient. Encourages the exploitation of the solution space and reflects how much the particle is influenced by its own best-known position
 }
   \item{c2}{
-numeric, social acceleration coefficient. Encourages the exploitation of the current global best and reflects how much the particle is influenced by the best-known optimum of the swarm 
+numeric, social acceleration coefficient. Encourages the exploration of the current global best and reflects how much the particle is influenced by the best-known optimum of the swarm 
 }
   \item{use.CF}{
 logical, indicates if the Clerc's Constriction Factor (see Clerc, 1999; Eberhart and Shi, 2000; Clerc and Kennedy, 2002) is used to avoid swarm explosion
-- 
GitLab