# HG changeset patch # User siwaa # Date 1687848450 0 # Node ID 70ae7516e925b8f04b34640bb6ee2132c8403afd # Parent f262814e48a372032cf415ae7c592d7d92289bc5 "planemo upload for repository https://forgemia.inra.fr/redelac/redelac-toolbox/-/tree/94d9549470e1fe96ae832b04bea58b2f1c5663fc/tools/REDELACSticsSimulator commit 94d9549470e1fe96ae832b04bea58b2f1c5663fc-dirty" diff -r f262814e48a3 -r 70ae7516e925 redelacSticsSimulator.R --- a/redelacSticsSimulator.R Mon Jun 26 17:25:19 2023 +0000 +++ b/redelacSticsSimulator.R Tue Jun 27 06:47:30 2023 +0000 @@ -8,23 +8,7 @@ javastics_path <- getwd() default_config_path <- paste0(javastics_path, "/config") -# copy of the var.mod and rap.mod into the config folder -# generalizing maybe should be inside a config folder - -#file.copy(from = file.path(workspace, "var.mod"), -# to = file.path(default_config_path, "var.mod"), -# overwrite = TRUE) -#file.copy(from = file.path(workspace, "rap.mod"), -# to = file.path(default_config_path, "rap.mod"), -# overwrite = TRUE) - txt_path <- paste0(getwd(), "/WS/txt_files") -#dir.create(txt_path,recursive = T) - -#gen_usms_xml2txt(javastics = javastics_path, -# workspace = workspace, -# out_dir = txt_path, -# check = FALSE) print("==================================") @@ -35,7 +19,6 @@ print("==================================") - # List of successive USMs successive_usms_file <- ("successionPlan.csv") successive_usms_tab <- read.csv(file = file.path(workspace, successive_usms_file), sep =";") @@ -51,9 +34,7 @@ # .packages = c("SticsRFiles", "SticsOnR") ) %dopar% { for(i in 1:nrow(successive_usms_tab)) { - print(paste("coucou ", i)) nusms <- as.numeric(successive_usms_tab[i,2]) - print(paste0("coco ", nusms)) vec <- as.character(successive_usms_tab[i,c(3:(2+nusms))]) @@ -65,11 +46,13 @@ verbose = TRUE, successive = list_successive_usms) list_usms <- vec - - result = append(result, stics_wrapper(model_options = sim_options, situation = list_usms)) + + singleResult = stics_wrapper(model_options = sim_options, situation = list_usms) + + result = append(result, list(singleResult)) } -#stopCluster(cl) +#stopCluster(cl) for (i in 1:nrow(successive_usms_tab)) { #i=1 if (i == 1) {