diff --git a/docker/R/lib/morris.R b/docker/R/lib/morris.R index 0998a9947..78f044c28 100644 --- a/docker/R/lib/morris.R +++ b/docker/R/lib/morris.R @@ -136,7 +136,8 @@ print(paste("levels:",levels)) print(paste("r:",r)) print(paste("r2:",r2)) print(paste("grid_jump:",grid_jump)) -print(paste("type:",type)) +print(paste("type:",type)) +print(paste("check_boundary:",check_boundary)) if (r2 > r) { r <- c(r,r2) @@ -152,17 +153,18 @@ m1 <- as.list(data.frame(t(m$X))) if (debug_messages == 1) { print(paste("m1:",m1)) } -print("check bounds") -boundary_check <- logical(ncol(vars)) -for (i in 1:ncol(vars)){ - boundary_check[i] <- all((m$X[,i] <= maxes[i]) && (m$X[,i] >= mins[i])) -} -if(!all(boundary_check)){ - print('SOLUTION SPACE OUT OF BOUNDS, CHECK Grid Jump and Level Values and/or re-run') - stop(options("show.error.messages"=TRUE),"SOLUTION SPACE OUT OF BOUNDS, CHECK Grid Jump and Level Values and/or re-run") -} -print("bounds are satisfied, continuing...") - +if (check_boundary == 1) { + print("check bounds") + boundary_check <- logical(ncol(vars)) + for (i in 1:ncol(vars)){ + boundary_check[i] <- all((m$X[,i] <= maxes[i]) && (m$X[,i] >= mins[i])) + } + if(!all(boundary_check)){ + print('SOLUTION SPACE OUT OF BOUNDS, CHECK Grid Jump and Level Values and/or re-run') + stop(options("show.error.messages"=TRUE),"SOLUTION SPACE OUT OF BOUNDS, CHECK Grid Jump and Level Values and/or re-run") + } + print("bounds are satisfied, continuing...") +} try(results <- clusterApplyLB(cl, m1, f),silent=FALSE) if (debug_messages == 1) { print(paste("nrow(results):",nrow(results))) diff --git a/server/app/lib/analysis_library/morris.rb b/server/app/lib/analysis_library/morris.rb index 397d05e82..4bb2ba396 100644 --- a/server/app/lib/analysis_library/morris.rb +++ b/server/app/lib/analysis_library/morris.rb @@ -50,6 +50,7 @@ def initialize(analysis_id, analysis_job_id, options = {}) r2: 20, levels: 4, grid_jump: 2, + check_boundary: 0, type: 'oat', norm_type: 'minkowski', p_power: 2, @@ -199,6 +200,7 @@ def perform r2: @analysis.problem['algorithm']['r2'], type: @analysis.problem['algorithm']['type'], grid_jump: @analysis.problem['algorithm']['grid_jump'], + check_boundary: @analysis.problem['algorithm']['check_boundary'], normtype: @analysis.problem['algorithm']['norm_type'], ppower: @analysis.problem['algorithm']['p_power'], objfun: @analysis.problem['algorithm']['objective_functions'],