-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmainScript.R
57 lines (41 loc) · 1.47 KB
/
mainScript.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#### 0. environment ####
rm(list=ls())
gc()
cat("\014")
#### 1. packages ####
library(rstudioapi)
current_path <- getActiveDocumentContext()$path
setwd(dirname(current_path ))
#### 1. read data and parameters ####
source("functions/readInputData.R")
source("functions/loadParameters.R")
source("functions/mainFunctions.R")
location <- "Junín"
waterCont <- "mid"
soil_series <- 'Santa Isabel'
soil_family <- 'Hapludol típico'
locationData <- list(location=location,
soil_series=soil_series,
soil_family=soil_family,
water=waterCont)
#### structure de decision into strategies and scenarios and evaluate combination with:
#### FWNM, FC, ROI, and Rotation
decision <- structureDecision(inputData,locationData)
#plot pure strategies
plotPureStrategies(decision)
#### add to evalDf Utility and Regrets
decision <- calculateMetrics(decision,parametersEU)
#### calculate objectives
decision <- calculateObjectivesByStrategy(decision,parametersList)
#### obtain the strategies optimal front
decision <- getMOFront(decision, parametersList)
#### plot MO
plotMOChart(decision)
#### explore scenarios by tree
classTree <- getTreeByObjective(decision,"E_ROI")
#### split the scenario set
decisionSplit <- splitByClassTree(decision, classTree)
#### explore vulnerabilities
plotTradeOff(decisionSplit,classTree)
#### compare two strategies by objective into Good and Bad
compare2strategies(decision,decisionSplit,classTree,66,1001)