Load required packages
In [ ]:
using DataFrames, Distributions, Gadfly, FishABM
Specify stock assumptions:
In [ ]:
s_a = StockAssumptions([0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50],
5,
[2500, 7500, 15000, 20000, 22500, 27500, 32500],
2,
0.25,
1,
[0.00001, 0.00002, 0.000025, 0.000025, 0.000025, 0.000025, 0.000025])
Specify environment assumptions:
In [ ]:
e_a = EnvironmentAssumptions(readdlm(Pkg.dir("FishABM")"/examples/LakeHuron_1km_spawning.csv", ',', Bool)[150:end, 200:370],
readdlm(Pkg.dir("FishABM")"/examples/LakeHuron_1km_habitat.csv", ',', Int)[150:end, 200:370],
readdlm(Pkg.dir("FishABM")"/examples/LakeHuron_1km_risk.csv", ',', Bool)[150:end, 200:370])
PadEnvironmentAssumptions!(e_a)
Specify agent assumptions:
In [ ]:
a_a = AgentAssumptions([[0.90 0.10 0.10]
[0.10 0.10 0.10]
[0.90 0.10 0.10]
[0.90 0.90 0.10]
[0.90 0.90 0.90]
[0.90 0.90 0.90]],
[0.0, 0.0, 0.0],
[19, 52, 104],
Array[[[0. 0. 0.]
[0. 1. 0.]
[0. 0. 0.]]
[[2. 4. 2.]
[1. 5. 2.]
[1. 1. 2.]]
[[2. 4. 2.]
[1. 4. 2.]
[1. 1. 2.]]],
[0., 0.2, 0.8])
Initialize stock database:
In [ ]:
s_db = StockDB(DataFrame(age_2=100000,
age_3=50000,
age_4=40000,
age_5=30000,
age_6=20000,
age_7=10000,
age_8=100000),
DataFrame(age_2=Int[],
age_3=Int[],
age_4=Int[],
age_5=Int[],
age_6=Int[],
age_7=Int[],
age_8=Int[]))
Begin life cycle simulation, specifying:
And indicating the previously specified objects:
In [ ]:
k = rand(Normal(500000, 50000),5)
a_db = simulate(k, [0], [100000], s_db, s_a, a_a, e_a, false, false)