Commit b812f569 authored by Romulo Pereira Goncalves's avatar Romulo Pereira Goncalves
Browse files

Print execution times of certain blcks for debug proposes.

parent a1859df4
......@@ -143,6 +143,7 @@ multi_Class_Sampling <- function(in.raster,
while (decision == "0") {
for (rs in 1:multiTest) {
########################
sample_nb.start = Sys.time()
maFo_rf <- sample_nb(
raster = in.raster,
nb_samples = seq(init.samples, init.samples, init.samples),
......@@ -161,7 +162,10 @@ multi_Class_Sampling <- function(in.raster,
parallel_mode = parallel_mode,
max_num_cores = max_num_cores
)
sample_nb.taken = difftime(Sys.time(), sample_nb.start, units = "secs")
print(sprintf("Sample_nb 1 took %f", sample_nb.taken))
distribution.start <- Sys.time()
index <- maFo_rf$index
acc <- maFo_rf$acc
maFo_rf <- maFo_rf$obj
......@@ -183,6 +187,8 @@ multi_Class_Sampling <- function(in.raster,
font = 2)
}
}
distribution.taken = difftime(Sys.time(), distribution.start, units = "secs")
print(sprintf("Iplot 3 took %f", distribution.taken))
}
decision <-
readline("Which distribution is acceptable/ or sample again [../0]: ")
......@@ -196,6 +202,7 @@ multi_Class_Sampling <- function(in.raster,
##########################################################################
} else{
########################
sample_nb.start = Sys.time()
maFo_rf <- sample_nb(
raster = in.raster,
nb_samples = seq(init.samples, init.samples, init.samples),
......@@ -214,6 +221,8 @@ multi_Class_Sampling <- function(in.raster,
parallel_mode = parallel_mode,
max_num_cores = max_num_cores
)
sample_nb.taken = difftime(Sys.time(), sample_nb.start, units = "secs")
print(sprintf("Sample_nb 2 took %f", sample_nb.taken))
index <- maFo_rf$index
acc <- maFo_rf$acc
......@@ -222,6 +231,8 @@ multi_Class_Sampling <- function(in.raster,
}
dummy <- maFo_rf@layer[[1]]
iplot.start <- Sys.time()
print("iplot1")
iplot(
x = dummy,
y = input_raster,
......@@ -233,6 +244,8 @@ multi_Class_Sampling <- function(in.raster,
outPath = outPath,
plot_on_browser = plot_on_browser
)
iplot.taken = difftime(Sys.time(), iplot.start, units = "secs")
print(sprintf("Iplot 1 took %f", iplot.taken))
decision <-
readline("Threshold for Habitat Extraction or Sample Again [../0]: ")
......@@ -254,6 +267,7 @@ multi_Class_Sampling <- function(in.raster,
paste("init.samples = ", sample2),
paste("models = ", models2)
))
sample_nb.start = Sys.time()
maFo_rf <- sample_nb(
raster = in.raster,
nb_samples = seq(sample2, sample2, sample2),
......@@ -272,13 +286,17 @@ multi_Class_Sampling <- function(in.raster,
parallel_mode = parallel_mode,
max_num_cores = max_num_cores
)
sample_nb.taken = difftime(Sys.time(), sample_nb.start, units = "secs")
print(sprintf("Sample_nb 3 took %f", sample_nb.taken))
index <- maFo_rf$index
acc <- maFo_rf$acc
maFo_rf <- maFo_rf$obj
########################
iplot.start = Sys.time()
dummy <- maFo_rf@layer[[1]]
print("iplot2")
iplot(
x = dummy,
y = input_raster,
......@@ -290,6 +308,8 @@ multi_Class_Sampling <- function(in.raster,
outPath = outPath,
plot_on_browser = plot_on_browser
)
iplot.taken = difftime(Sys.time(), iplot.start, units = "secs")
print(sprintf("Iplot 2 took %f", iplot.taken))
decision <-
readline("Threshold for Habitat Extraction or Sample Again [../0]: ")
......
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