Skip to content
Snippets Groups Projects
Commit 3338624f authored by Marco Matthies's avatar Marco Matthies
Browse files

Remove redundant argument for initfields!

parent a17a1c24
No related branches found
No related tags found
No related merge requests found
......@@ -140,7 +140,7 @@ function initmodel(settings::Dict{String, Any})
)
saveinputfiles(model)
initfields!(model, settings["crop.cropmodel"])
initfields!(model)
initfarms!(model)
initnature!(model)
model
......
......@@ -24,7 +24,7 @@ end
Initialise the model with its farm plots.
"""
function initfields!(model::SimulationModel, cropmodel::AbstractString)
function initfields!(model::SimulationModel)
n = 0
convertid = Dict{Int64,Int64}()
width, height = size(model.landscape)
......@@ -40,7 +40,7 @@ function initfields!(model::SimulationModel, cropmodel::AbstractString)
model.landscape[x,y].fieldid = objectid
push!(model.farmplots[objectid].pixels, (x,y))
else
cropstate = make_cropstate(model, cropmodel)
cropstate = make_cropstate(model, @param(crop.cropmodel))
fp = FarmPlot(
length(model.farmplots) + 1,
[(x, y)],
......
......@@ -6,8 +6,7 @@
@testset "Landscape initialisation" begin
model = inittestmodel(false)
# these tests are specific to the Jena maps
cropmodel = "almass"
@test_logs (:info, "Initialised 2092 farm plots.") match_mode=:any Ps.initfields!(model, cropmodel)
@test_logs (:info, "Initialised 2092 farm plots.") match_mode=:any Ps.initfields!(model)
@test size(model.landscape) == (1754, 1602)
@test Ps.landcover((100,100), model) == Ps.forest
@test Ps.landcover((300,1), model) == Ps.soil
......
......@@ -43,7 +43,7 @@ function inittestmodel(smallmap=true)
TESTSETTINGS["world.weatherfile"]),
TESTSETTINGS["core.startdate"],
TESTSETTINGS["core.enddate"])
# TODO: allow init of other crop models besides ALMaSS
# TODO: support other crop models besides ALMaSS
crops = Ps.ALMaSS.readcropparameters(TESTSETTINGS["crop.cropfile"],
TESTSETTINGS["crop.growthfile"])
farmers = Vector{Farmer}()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment