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 configurations
model.jldata structures and processes that make up the model itself
analysis.jlobservations and data output
setup.jlcreate a runnable model
draw_gui.jldraw the model to a canvas
run_gui.jlties everything together, creates model from commandline parameters and runs it with GUI
run_cmdl.jlties everything together, creates model from commandline parameters and runs without gui
Changing the model
In order to implement a new model only a few of the included files have to be changed:
model.jlfor the model itself
setup.jlfor model-specific setup and initialisation
params.jlto define model parameters
And for the GUI version:
draw_gui.jlto display the model
run_cmdl.jlfor model-specific graphs
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:
SimpleDirectMediaLayer (for GUI only)