@@ -26,7 +26,8 @@ getInitialDesign <- function(algorithm, input, output) {
26
26
set.seed(algorithm $ seed )
27
27
algorithm $ m <- morris(model = NULL , factors = d , r = algorithm $ r ,
28
28
design = list (type = " oat" , levels = algorithm $ levels ))
29
- return (algorithm $ m $ X )
29
+ names(algorithm $ m $ X ) <- names(input )
30
+ return (from01(algorithm $ m $ X ,input ))
30
31
}
31
32
32
33
getNextDesign <- function (algorithm , X , Y ) {
@@ -39,7 +40,7 @@ displayResults <- function(algorithm, X, Y) {
39
40
40
41
algorithm $ files = " plot.png"
41
42
png(file = algorithm $ files , bg = " transparent" , height = 600 , width = 600 )
42
- plot(algorithm $ m )
43
+ try( plot(algorithm $ m ) )
43
44
dev.off()
44
45
45
46
mu = colMeans(algorithm $ m $ ee )
@@ -60,3 +61,21 @@ displayResults <- function(algorithm, X, Y) {
60
61
}
61
62
62
63
displayResultsTmp <- function (algorithm , X , Y ) {}
64
+
65
+ from01 = function (X , inp ) {
66
+ nX = names(X )
67
+ for (i in 1 : ncol(X )) {
68
+ namei = nX [i ]
69
+ X [,i ] = X [,i ] * (inp [[ namei ]]$ max - inp [[ namei ]]$ min ) + inp [[ namei ]]$ min
70
+ }
71
+ return (X )
72
+ }
73
+
74
+ to01 = function (X , inp ) {
75
+ nX = names(X )
76
+ for (i in 1 : ncol(X )) {
77
+ namei = nX [i ]
78
+ X [,i ] = (X [,i ] - inp [[ namei ]]$ min ) / (inp [[ namei ]]$ max - inp [[ namei ]]$ min )
79
+ }
80
+ return (X )
81
+ }
0 commit comments