-
Notifications
You must be signed in to change notification settings - Fork 0
/
manScalePN-moranIfertLoss.oms
55 lines (48 loc) · 1.49 KB
/
manScalePN-moranIfertLoss.oms
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
// Import the model plugin
import _file_.modelDeclarationMoran._
val moranI = Val[Double]
val fertLossTime = Val[Double]
val P = Val[Double]
val N = Val[Double]
val eukaryoteEnvironment = LocalEnvironment(5)
val readModelOutput =
ScalaTask("""
// read file as an array of lines and get last line
val lastLine = scala.io.Source.fromFile(output).getLines.toList.last.mkString
// split the string and store it in an array
val values = lastLine.split(" ")
val moranI = values(0).toDouble
val fertLossTime = values(1).toDouble
val P = values(2).toDouble
"""
)set(
inputs+=output,
(inputs,outputs)+=(a0,nF,a),
outputs+=(moranI,fertLossTime,P)
)
// this exectues the model and reads the outputs to work on OpenMole
val modelRunAndRead = MoleTask(modelPluginEuka -- readModelOutput)
val replications = Replication(
evaluation = modelRunAndRead,
seed = mySeed,
sample = 10,
aggregation = Seq (
moranI aggregate average,
fertLossTime aggregate average,
P aggregate average,
a0 aggregate average,
nF aggregate average,
a aggregate average
)
)
val sampling3D = DirectSampling(
evaluation = replications,
sampling =
(T is 0.0) x
(L is 100.0) x
(d0 is 0.0) x
(a in Seq(0.0,0.5,1.0)) x
(a0 in Seq(0.2,0.4,0.6)) x
(nF in Seq(1.0,2.0,4.0,8.0,16.0,32.0,64.0,128.0,256.0,512.0,1024.0)),
)
(sampling3D on eukaryoteEnvironment hook (workDirectory / "manScale-moranIfertLoss.csv"))