Skip to content

Commit 99f6721

Browse files
authored
Merge pull request #10 from PumasAI-Labs/htbunn-patch-1
Update cts_distributed.jl
2 parents 800db26 + 1a629fb commit 99f6721

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

simulation/qualification.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ coreqpc = map(zip(inspectdfs, coreparams)) do (idf, param)
132132
plt = plot_qpc(refq50, q5, q50, q95, refvalue, "50th Percentile for "*uppercase(string(p)))
133133

134134
try
135-
save(joinpath("results",OUTDIR,string(param)*"_qpc.png"), plt)
135+
save(joinpath("results",OUTDIR,string(p)*"_qpc.png"), plt)
136136
catch e
137137
@info "Could not save $(string(p)) QPC plot"
138138
end
@@ -183,9 +183,9 @@ derivedqpc = map(zip(inspectdfs, observedvals)) do (idf, val)
183183
plt = plot_qpc(refq50, q5, q50, q95, refvalue, "50th Percentile for "*uppercase(string(v)))
184184

185185
try
186-
save(joinpath("results",OUTDIR,string(val)*"_qpc.png"), plt)
186+
save(joinpath("results",OUTDIR,string(v)*"_qpc.png"), plt)
187187
catch e
188-
@info "Could not save $(string(val)) QPC plot"
188+
@info "Could not save $(string(v)) QPC plot"
189189
end
190190

191191
return plt
@@ -228,4 +228,4 @@ try
228228
save(joinpath("results",OUTDIR,"sdmaredbl_qpc.png"), plt)
229229
catch e
230230
@info "Could not save SDMA reduction QPC plot"
231-
end
231+
end

simulation/template/cts_distributed.jl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ ADJ6MG = (
6464
##################################################################
6565
@info "Load Simulation Functions"
6666
# load simulation functions
67-
include("./utils/sim_functions.jl")
67+
@everywhere include("./utils/sim_functions.jl")
6868

6969

7070
##################################################################
@@ -74,6 +74,9 @@ include("./utils/sim_functions.jl")
7474
# Set number of subjects to simulate in each scenario
7575
subjects_to_sim = 500;
7676

77+
# Set number of cycles
78+
ncycles = 3;
79+
7780
# empty dataframe to sim info and results
7881
mysims = DataFrame();
7982

@@ -114,7 +117,7 @@ end;
114117
mysims[!, :sims] = pmap(eachrow(mysims)) do r
115118
map(eachrow(r.patients)) do subr
116119
try
117-
return sim_trial(subr, 3);
120+
return sim_trial(subr, ncycles);
118121
catch e
119122
return e
120123
end
@@ -126,5 +129,5 @@ end;
126129
##################################################################
127130
@info "Serialize Results"
128131
open(result_filename, "w") do io
129-
serialize(io, sims_df)
130-
end
132+
serialize(io, mysims)
133+
end

0 commit comments

Comments
 (0)