From 03e65514401b3d6f28ea0b03bc79f6b6d68177a9 Mon Sep 17 00:00:00 2001 From: Daniel Vedder <daniel.vedder@idiv.de> Date: Thu, 22 Dec 2022 11:45:47 +0100 Subject: [PATCH] Export all types from module --- src/Persephone.jl | 12 +++++++++++- test/landscape_tests.jl | 11 +++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/Persephone.jl b/src/Persephone.jl index 5ab364d..8849be7 100644 --- a/src/Persephone.jl +++ b/src/Persephone.jl @@ -23,12 +23,22 @@ using TOML ## define exported functions and variables -#XXX export all types? export + #types + LandCover, + EventType, + Pixel, + FarmEvent, + FarmPlot, + Sex, + Animal, + Farmer, + #functions param, simulate, initialise, stepsimulation!, + createevent!, finalise ## The file that stores all default parameters diff --git a/test/landscape_tests.jl b/test/landscape_tests.jl index be848ea..11422d2 100644 --- a/test/landscape_tests.jl +++ b/test/landscape_tests.jl @@ -8,7 +8,7 @@ landscape = Persephone.initlandscape() space = GridSpace(size(landscape), periodic=false) properties = Dict{Symbol,Any}(:landscape=>landscape) - model = AgentBasedModel(Persephone.FarmPlot, space, properties=properties, + model = AgentBasedModel(FarmPlot, space, properties=properties, rng=Random.Xoshiro(param("core.seed")), warn=false) Persephone.initfields!(model) # these tests are specific to the Jena maps @@ -31,13 +31,12 @@ end space = GridSpace(size(landscape), periodic=false) properties = Dict{Symbol,Any}(:date=>param("core.startdate"), :landscape=>landscape, - :events=>Vector{Persephone.FarmEvent}()) - model = AgentBasedModel(Union{Persephone.Farmer,Persephone.Animal,Persephone.FarmPlot}, - space, properties=properties, + :events=>Vector{FarmEvent}()) + model = AgentBasedModel(Union{Farmer,Animal,FarmPlot}, space, properties=properties, rng=Random.Xoshiro(param("core.seed")), warn=false) # create some events and see whether they show up on the map and disappear as they should - Persephone.createevent!(model, [(1,1), (1,2), (1,3), (2,1), (2,3)], Persephone.tillage) - Persephone.createevent!(model, [(1,1), (1,2), (1,3), (2,2)], Persephone.sowing, 2) + createevent!(model, [(1,1), (1,2), (1,3), (2,1), (2,3)], Persephone.tillage) + createevent!(model, [(1,1), (1,2), (1,3), (2,2)], Persephone.sowing, 2) @test model.landscape[1,1].events == [Persephone.tillage, Persephone.sowing] @test model.landscape[2,1].events == [Persephone.tillage] @test model.landscape[2,2].events == [Persephone.sowing] -- GitLab