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

Add cropcover function, fix cropheight return value in case it isn't a farm plot

parent 9d43f793
No related branches found
No related tags found
No related merge requests found
......@@ -59,6 +59,17 @@ Return the height of the crop at this position, or nothing if there is no crop h
(utility wrapper).
"""
function cropheight(pos::Tuple{Int64,Int64}, model::SimulationModel)
ismissing(model.landscape[pos...].fieldid) ? nothing :
ismissing(model.landscape[pos...].fieldid) ? 0.0cm : # TODO: 0.0cm correct here?
cropheight(model.farmplots[model.landscape[pos...].fieldid])
end
"""
cropcover(model, position)
Return the crop cover of the crop at this position, or nothing if
there is no crop here (utility wrapper).
"""
function cropcover(pos::Tuple{Int64,Int64}, model::SimulationModel)
ismissing(model.landscape[pos...].fieldid) ? 0.0 : # TODO: 0.0 correct here?
cropcover(model.farmplots[model.landscape[pos...].fieldid])
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment