diff --git a/src/crop/farmplot.jl b/src/crop/farmplot.jl index 39755b5dc2c5afed7d8e9dfd5c83d7d34e14e7ed..c03d2c2d97f65265d9cfbcbc2f1fb5ad0bf45f9e 100644 --- a/src/crop/farmplot.jl +++ b/src/crop/farmplot.jl @@ -6,14 +6,14 @@ mutable struct FarmPlot{T} <: ModelAgent const id::Int64 pixels::Vector{Tuple{Int64, Int64}} - crop_state :: T + cropstate :: T end -croptype(f::FarmPlot{T}) where {T} = croptype(f.crop_state) +croptype(f::FarmPlot{T}) where {T} = croptype(f.cropstate) cropname(f::FarmPlot{T}) where {T} = cropname(croptype(f)) -cropheight(f::FarmPlot{T}) where {T} = cropheight(f.crop_state) -cropcover(f::FarmPlot{T}) where {T} = cropcover(f.crop_state) -cropyield(f::FarmPlot{T}) where {T} = cropyield(f.crop_state) +cropheight(f::FarmPlot{T}) where {T} = cropheight(f.cropstate) +cropcover(f::FarmPlot{T}) where {T} = cropcover(f.cropstate) +cropyield(f::FarmPlot{T}) where {T} = cropyield(f.cropstate) """ stepagent!(farmplot, model) @@ -21,7 +21,7 @@ cropyield(f::FarmPlot{T}) where {T} = cropyield(f.crop_state) Update a farm plot by one day. """ function stepagent!(farmplot::FarmPlot{T}, model::SimulationModel) where T - stepagent!(farmplot.crop_state, model) + stepagent!(farmplot.cropstate, model) end """ @@ -32,7 +32,7 @@ Sow the specified crop on the farmplot. function sow!(farmplot::FarmPlot, model::SimulationModel, cropname::String) #XXX test if the crop is sowable? createevent!(model, farmplot.pixels, sowing) - sow!(farmplot.crop_state, model, cropname) + sow!(farmplot.cropstate, model, cropname) end """ @@ -42,7 +42,7 @@ Harvest the crop of this farmplot. """ function harvest!(farmplot::FarmPlot{T}, model::SimulationModel) where T createevent!(model, farmplot.pixels, harvesting) - harvest!(farmplot.crop_state, model) # TODO: multiply with area to return units of `g` + harvest!(farmplot.cropstate, model) # TODO: multiply with area to return units of `g` end ## UTILITY FUNCTIONS