From 05db579340ff963ff04ac7b8306410d46367f340 Mon Sep 17 00:00:00 2001
From: Mauricio Zambrano-Bigiarini <hzambran@users.noreply.github.com>
Date: Mon, 19 Nov 2012 13:28:51 +0000
Subject: [PATCH] added: pest2hydroPSO.Rd, pest2hydroPSO.Rd

---
 R/PSO_v2012.R   | 8 ++++++--
 R/plot_2parOF.R | 5 +++++
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/R/PSO_v2012.R b/R/PSO_v2012.R
index 975e406..0948dfc 100755
--- a/R/PSO_v2012.R
+++ b/R/PSO_v2012.R
@@ -2002,6 +2002,7 @@ hydroPSO <- function(
 
     if (topology != "random") {
       nc <- K  
+      #nc <- npart
       if (trunc(K/2) != ceiling(K/2)) {
         N   <- (K-1)/2
       } else N  <- K/2
@@ -2915,8 +2916,11 @@ hydroPSO <- function(
       write.table(format(tmp, scientific=TRUE, digits=digits), file=fname, col.names=TRUE, row.names=FALSE, sep="  ", quote=FALSE)
 
       # Writing the file 'X.neighbours.txt' 
-      fname <- paste(file.path(drty.out), "/", "Particles_Neighbours.txt", sep="") 	
-      write.table(X.neighbours, file=fname, col.names=paste("Neigh", 1:npart, sep=""), row.names=paste("Part", 1:npart, sep=""), sep="  ", na="", quote=FALSE) 
+      fname <- paste(file.path(drty.out), "/", "Particles_Neighbours.txt", sep="") 
+      print(X.neighbours)	
+      print(paste("Neigh", 1:npart, sep=""))
+      ifelse(topology == "lbest", nc <- K, nc <- npart)
+      write.table(X.neighbours, file=fname, col.names=paste("Neigh", 1:nc, sep=""), row.names=paste("Part", 1:npart, sep=""), sep="  ", na="", quote=FALSE) 
 
       # Writing the file 'LocalBest.txt' 
       fname <- paste(file.path(drty.out), "/", "LocalBest.txt", sep="") 	
diff --git a/R/plot_2parOF.R b/R/plot_2parOF.R
index 31f5887..fd20afa 100755
--- a/R/plot_2parOF.R
+++ b/R/plot_2parOF.R
@@ -89,6 +89,11 @@ plot_2parOF <- function(params,
     ifelse(MinMax=="max", decreasing<-FALSE, decreasing<-TRUE)
     p <- p[order(p[, gof.name], decreasing = decreasing), ]
     
+    # Define a transformation
+    norm_trans <- function(){
+      trans_new('norm', function(x) pnorm(x), function(x) qnorm(x))
+    }
+  
     if (type=="sp") {
       colnames(p) <- c("x", "y", gof.name)
       
-- 
GitLab