@@ -452,12 +452,18 @@ check_filedir <- function(plot_folder) {
452452check_calibconstr <- function (calibration_constraint , iterations , trials , calibration_input ) {
453453 if (! is.null(calibration_input )) {
454454 total_iters <- iterations * trials
455- if (calibration_constraint < 0.01 | calibration_constraint > 0.1 ) {
455+ if (calibration_constraint < 0.01 || calibration_constraint > 0.1 ) {
456+ message(" calibration_constraint must be >=0.01 and <=0.1. Changed to default value: 0.1" )
456457 calibration_constraint <- 0.1
457- message(" calibration_constraint must be >=0.01 and <=0.1. Using default value 0.1" )
458- } else if (total_iters * calibration_constraint < 500 ) {
459- warning(" Calibration constraint set to be top " , calibration_constraint * 100 , " % calibrated models." ,
460- " Only " , round(total_iters * calibration_constraint ,0 ), " models left for pareto-optimal selection" )
458+ }
459+ models_lower <- 500
460+ if (total_iters * calibration_constraint < models_lower ) {
461+ warning(sprintf(paste(
462+ " calibration_constraint set for top %s%% calibrated models." ,
463+ " %s models left for pareto-optimal selection. Minimum suggested: %s" ),
464+ calibration_constraint * 100 ,
465+ round(total_iters * calibration_constraint , 0 ),
466+ models_lower ))
461467 }
462468 }
463469 return (calibration_constraint )
0 commit comments