-
Notifications
You must be signed in to change notification settings - Fork 0
/
00_generate_simulation_parameters.jl
67 lines (58 loc) · 1.61 KB
/
00_generate_simulation_parameters.jl
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
58
59
60
61
62
63
64
65
66
67
using UUIDs
using DataFrames
import CSV
import Random
rng = Random.seed!(314)
input_path = joinpath(dirname(Base.active_project()), "inputs")
if ~ispath(input_path)
mkpath(input_path)
end
output_path = joinpath(dirname(Base.active_project()), "outputs")
if ~ispath(output_path)
mkpath(output_path)
end
if ~ispath("slurm")
mkpath("slurm")
end
bank = DataFrame()
centers = collect(0:5:100)
barycenters = [(c1, c2, c3) for c1 in centers for c2 in centers for c3 in centers]
filter!(b -> isequal(100)(sum(b)), barycenters)
for b in barycenters
for density in [true, false]
sigma_infection = density ? 0.001 : 0.01
push!(bank, (
parameters=uuid4(rng),
seed=rand(1:200_000),
mutualism=b[1],
competition=b[2],
predation=b[3],
density=density,
replicates=1000,
richness=50,
time=1000,
connectance=0.5,
carrying_capacity=100.0,
sigma_interaction=0.2,
sigma_infection=sigma_infection,
regulation=0.02,
virulence=0.05,
recovery=0.05,
half_saturation=30.0
))
end
end
CSV.write(joinpath(input_path, "sets.csv"), bank)
# Write the SLURM file to go with the job
job_file = """
#! /bin/bash
#SBATCH --array=1-$(size(bank, 1))
#SBATCH --time=02:00:00
#SBATCH --mem-per-cpu=2500M
#SBATCH --cpus-per-task=64
#SBATCH --job-name=comm-epi-mod
#SBATCH --output=$(joinpath("slurm", "%x-%a.out"))
module load StdEnv/2020 julia/1.9.1
julia --project -t 64 01_run_one_parameter.jl
"""
write("dilution.sh", job_file)