-
Notifications
You must be signed in to change notification settings - Fork 1
/
run_evolution.jl
67 lines (58 loc) · 1.83 KB
/
run_evolution.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 Pkg
Pkg.activate(".")
using ReactionNetworkEvolution
using ArgParse
function parse_initial_concentrations(initial_concentrations::String)
# Strip whitespace
initial_concentrations = filter(x -> !isspace(x), initial_concentrations)
# Strip brackets
initial_concentrations = initial_concentrations[2:end-1]
# Separate by commas
initial_concentrations = split(initial_concentrations, ",")
new_array = Vector{Float64}()
for num in initial_concentrations
push!(new_array, parse(Float64, num))
end
return new_array
end
s = ArgParseSettings()
@add_arg_table s begin
"--ngenerations"
arg_type = Int
default = -1
"--ntrials"
arg_type = Int
default = -1
"--nspecies"
arg_type = Int
default = 3
"--initial_concentrations"
arg_type = String
default = "[1., 5., 9.]"
"--population_size"
arg_type = Int
default = -1
"--pathtosettings"
arg_type = String
default = ""
"--outputpath"
arg_type = String
default=""
"--seed"
arg_type = Int
default = -1
"--note"
arg_type = String
default = ""
end
parsed_args = parse_args(ARGS, s)
parsed_args["initial_concentrations"] = parse_initial_concentrations(parsed_args["initial_concentrations"])
ReactionNetworkEvolution.run_evolution(ngenerations=parsed_args["ngenerations"],
ntrials=parsed_args["ntrials"],
nspecies=parsed_args["nspecies"],
initial_concentrations = parsed_args["initial_concentrations"],
population_size=parsed_args["population_size"],
pathtosettings=parsed_args["pathtosettings"],
outputpath=parsed_args["outputpath"],
seed=parsed_args["seed"],
note=parsed_args["note"])