Skip to content
Snippets Groups Projects
Commit 37b148e9 authored by Mauricio Zambrano-Bigiarini's avatar Mauricio Zambrano-Bigiarini
Browse files

hydroPSO: fixed small bug in the new 'random.update' parameter

parent 3fa10ced
No related branches found
No related tags found
No related merge requests found
...@@ -1431,7 +1431,7 @@ hydroPSO <- function( ...@@ -1431,7 +1431,7 @@ hydroPSO <- function(
Xini.type <- match.arg(control[["Xini.type"]], con[["Xini.type"]]) Xini.type <- match.arg(control[["Xini.type"]], con[["Xini.type"]])
Vini.type <- match.arg(control[["Vini.type"]], con[["Vini.type"]]) Vini.type <- match.arg(control[["Vini.type"]], con[["Vini.type"]])
best.update <- match.arg(control[["best.update"]], con[["best.update"]]) best.update <- match.arg(control[["best.update"]], con[["best.update"]])
random.update <- as.logical(con[["rand.update"]]) random.update <- as.logical(con[["random.update"]])
boundary.wall <- match.arg(control[["boundary.wall"]], con[["boundary.wall"]]) boundary.wall <- match.arg(control[["boundary.wall"]], con[["boundary.wall"]])
topology <- match.arg(control[["topology"]], con[["topology"]]) topology <- match.arg(control[["topology"]], con[["topology"]])
K <- con[["K"]] K <- con[["K"]]
...@@ -2178,9 +2178,9 @@ hydroPSO <- function( ...@@ -2178,9 +2178,9 @@ hydroPSO <- function(
################### Particles Loop (j) - Start ######################## ################### Particles Loop (j) - Start ########################
########################################################################## ##########################################################################
ifelse(random.update, index <- sample(npart), index <- 1:npart) ifelse(random.update, index.part.upd <- sample(npart), index.part.upd <- 1:npart)
for (j in index) { for (j in index.part.upd) {
if (write2disk) { if (write2disk) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment