A very simple standalone ABM example in Julia that can be used as a starting point for a new ABM implementation.
All model-specific code is contained in lower-case .jl files. All other files contain modules that are more or less general and can be reused.
The main parts of the model:
setup_world.jlfunctions to create the world in different configurationsmodel.jldata structures and processes that make up the model itselfanalysis.jlobservations and data outputsetup.jlcreate a runnable modelparams.jlmodel parametersdraw_gui.jldraw the model to a canvasrun_gui.jlties everything together, creates model from commandline parameters and runs it with GUIrun_cmdl.jlties everything together, creates model from commandline parameters and runs without gui
In order to implement a new model only a few of the included files have to be changed:
model.jlfor the model itselfsetup.jlfor model-specific setup and initialisationparams.jlto define model parametersanalysis.jlfor output
And for the GUI version:
draw_gui.jlto display the modelrun_gui.jlfor model-specific graphs
Run as julia run_gui.jl or julia run_cmdl.jl. Run with --help to see commandline options.
draw_vector.jl contains currently unused code to draw the world as an SVG image using Luxor.
In order to run the model the following packages have to be installed:
- MiniEvents
- MiniObserve
- DataStructures
- Distributions
- ArgParse
- Parameters
- MacroTools
- StaticArrays
- SimpleDirectMediaLayer (for GUI only)