-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunSim.R
More file actions
43 lines (36 loc) · 1.03 KB
/
runSim.R
File metadata and controls
43 lines (36 loc) · 1.03 KB
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
createNetwork <- function(topologyFile){
topology = load_gold_standard(topologyFile)
bm = bmat(dim(topology)[1])
bm = bm*topology
bm = applyDegradation(bm)
return(bm)
}
initialValues <- function(ratiosFile){
load(ratiosFile)
xinit = ratios[,1]
return(xinit)
}
runSim <- function(topologyFile, ratiosFile, setNumber){
syntheticNet = createNetwork(topologyFile)
xinit = initialValues(ratiosFile)
maxInitial = max(xinit)
# browser()
syntheticData = solveLDE(xinit, syntheticNet, 5, 1440, 0.01)
# browser()
extract = extractTraj(syntheticData, 21)
# while(max(syntheticData) > 2*maxInitial){
# laregRows = NULL
# for(i in seq_len(dim(syntheticData)[1])){
# if(max(syntheticData[i,]) > 2*maxInitial)
# largeRows = append(laregRows, i)
# }
#
# syntheticNet[ , laregRows] = syntheticNet[ , laregRows]/2
# # browser()
# syntheticData = solveLDE(xinit, syntheticNet, 5, 1440, 0.001)
# }
saveExtract(extract, setNumber)
saveSolution(xinit, syntheticNet, setNumber)
saveSynthData(syntheticData, setNumber)
plotLDE(syntheticData)
}