diff --git a/src/Persephone.jl b/src/Persephone.jl index 5ab364d48cfd30a2d10e34e516e8935dc6d52b41..8849be701726aa67b42a152c210424bc0c84c1db 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 be848eabcd10aaabd70d8c9203c240456614d6d3..11422d28b3efd2c28a47dbb33fd1a1b31c6c58f0 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]