Commit 4b4c4aee authored by unknown's avatar unknown
Browse files

v1.0.3 replace cat() by message() in Calibration_Michel()

parent d090c5c7
......@@ -105,13 +105,13 @@ Calibration_Michel <- function(InputsModel,RunOptions,InputsCrit,CalibOptions,FU
iNewOptim <- 0;
Ncandidates <- nrow(CandidatesParamR);
if(verbose & Ncandidates>1){
if(PrefilteringType==1){ cat(paste("\t List-Screening in progress (",sep="")); }
if(PrefilteringType==2){ cat(paste("\t Grid-Screening in progress (",sep="")); }
cat("0%");
if(PrefilteringType==1){ message("List-Screening in progress (", appendLF = FALSE) }
if(PrefilteringType==2){ message("Grid-Screening in progress (", appendLF = FALSE) }
message("0%", appendLF = FALSE)
}
for(iNew in 1:nrow(CandidatesParamR)){
if(verbose & Ncandidates>1){
for(k in c(2,4,6,8)){ if(iNew==round(k/10*Ncandidates)){ cat(paste(" ",10*k,"%",sep="")); } }
for(k in c(2,4,6,8)){ if(iNew==round(k/10*Ncandidates)){ message(" ", 10*k, "%",appendLF = FALSE) } }
}
##Model_run
Param <- CandidatesParamR[iNew,];
......@@ -129,7 +129,7 @@ Calibration_Michel <- function(InputsModel,RunOptions,InputsCrit,CalibOptions,FU
Multiplier <- OutputsCrit$Multiplier;
}
}
if(verbose & Ncandidates>1){ cat(" 100%) \n"); }
if(verbose & Ncandidates>1){ message(" 100%)\n", appendLF = FALSE) }
##End_of_first_step_Parameter_Screening____________________________________
......@@ -138,10 +138,14 @@ Calibration_Michel <- function(InputsModel,RunOptions,InputsCrit,CalibOptions,FU
CritStart <- CritOptim;
NRuns <- NRuns+nrow(CandidatesParamR);
if(verbose){
if(Ncandidates> 1){ cat(paste("\t Screening completed (",NRuns," runs): \n",sep="")); }
if(Ncandidates==1){ cat(paste("\t Starting point for steepest-descent local search: \n",sep="")); }
cat(paste("\t Param = ",paste(formatC(ParamStartR,format="f",width=8,digits=3),collapse=" , "),"\n",sep=""));
cat(paste("\t Crit ",format(CritName,width=12,justify="left")," = ",formatC(CritStart*Multiplier,format="f",digits=4),"\n",sep=""));
if(Ncandidates> 1){
message("\t Screening completed (", NRuns, " runs):")
}
if(Ncandidates==1){
message("\t Starting point for steepest-descent local search:")
}
message("\t Param = ", paste(formatC(ParamStartR, format = "f", width = 8, digits = 3), collapse = " , "))
message("\t Crit ", format(CritName, width = 12, justify = "left"), " = ", formatC(CritStart*Multiplier, format = "f", digits = 4))
}
##Results_archiving________________________________________________________
HistParamR[1,] <- ParamStartR;
......@@ -192,7 +196,7 @@ Calibration_Michel <- function(InputsModel,RunOptions,InputsCrit,CalibOptions,FU
##Initialisation_of_variables
if(verbose){
cat("\t Steepest-descent local search in progress \n");
message("Steepest-descent local search in progress")
}
Pace <- 0.64;
PaceDiag <- rep(0,NParam);
......@@ -307,7 +311,7 @@ Calibration_Michel <- function(InputsModel,RunOptions,InputsCrit,CalibOptions,FU
##Case_when_the_starting_parameter_set_remains_the_best_solution__________
if(CritOptim==CritStart & verbose){
cat("\t No progress achieved \n");
message("\t No progress achieved");
}
##End_of_Steepest_Descent_Local_Search____________________________________
......@@ -316,9 +320,9 @@ Calibration_Michel <- function(InputsModel,RunOptions,InputsCrit,CalibOptions,FU
CritFinal <- CritOptim;
NIter <- 1+ITER;
if(verbose){
cat(paste("\t Calibration completed (",NIter," iterations, ",NRuns," runs): \n",sep=""));
cat(paste("\t Param = ",paste(formatC(ParamFinalR,format="f",width=8,digits=3),collapse=" , "),"\n",sep=""));
cat(paste("\t Crit ",format(CritName,width=12,justify="left")," = ",formatC(CritFinal*Multiplier,format="f",digits=4),"\n",sep=""));
message("\t Calibration completed (", NIter, " iterations, ", NRuns, " runs)")
message("\t Param = ", paste(formatC(ParamFinalR, format = "f", width = 8, digits = 3), collapse = " , "))
message("\t Crit ", format(CritName, width = 12, justify = "left"), " = ", formatC(CritFinal*Multiplier, format = "f", digits = 4))
}
##Results_archiving_______________________________________________________
HistParamR <- cbind(HistParamR[1:NIter,]); colnames(HistParamR) <- paste("Param",1:NParam,sep="");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment