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

Update to newest version of AquaCrop, implement stepagent!() for AquaCropState

parent 4c5b17c2
Branches
No related tags found
No related merge requests found
......@@ -16,7 +16,7 @@ mutable struct AquaCropState
function AquaCropState(croptype::AquaCropType, height::Length{Float64}=0.0cm)
ac_parentdir = AquaCrop.test_toml_dir # TODO: hardcoded croptype
ac_runtype = :Julia
ac_runtype = :Toml
cropstate, allok = AquaCrop.initialize_cropfield(; parentdir=ac_parentdir, runtype=ac_runtype)
if ! allok.logi
error("AquaCrop.initialize_cropfield() failed, status = $allok")
......@@ -38,7 +38,7 @@ isharvestable(cs::AquaCropState) = true # TODO: implement this correctly
Update a crop state by one day.
"""
function stepagent!(cs::AquaCropState, model::SimulationModel)
# TODO: call into AquaCrop.jl to simulate one day
AquaCrop.dailyupdate!(cs.cropstate)
end
"""
......
......@@ -19,6 +19,7 @@ import Unitful
model = initialise(parampath)
stepsimulation!(model)
@test model isa AgricultureModel
# TODO: test stepagent!(), sow!(), harvest!()
end
end
......@@ -69,5 +70,4 @@ end
@test cropheight(fp) isa Length{Float64}
@test cropcover(fp) isa Float64
@test Unitful.dimension(cropyield(fp)) == Unitful.𝐌 * Unitful.𝐋^-2
# TODO: test stepagent!(), sow!(), harvest!()
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment