Data storage
[Agent practical 1 of 9]


Not all ABM have all the ABM elements, so, for example, you may have an ABM where the agents only interact with the environment and not each other. However, here we're going to build a relatively generic model which will contain all the core elements.

Because of this, and because we want to concentrate on the programming rather than the application of programming, the agents will have relatively simple behaviours and the model will be relatively abstract. Hopefully, however, it will be clear how the code could act as the framework for more problem-centred models or analysis toolkits.

If you want to imagine the model as something real, you can imagine it as modelling herbivores like sheep in an environment. The model is going to involve agents wandering around and eating material (data) from the underlying landscape. However, the model can act as the foundation for a very wide range of models, not limited to ecological scenarios -- as we'll discuss towards the end of our coding.


Essentially, over these practicals we're going to build up a model that:

 

Screenshot: final model

As you can see, although the behaviour is simple (eating the environment data) it involves checking the environment to see what's in a location and changing it, along with interacting with other agents on a neighbourhood basis(asking them if they are in a neighbourhood around a position). As such, the code gives the foundations for a wide range of models.

In addition, in giving you code that reads, displays, and writes data files, it gives you the core elements of any data analysis tool, should you wish to chuck out the agent-based modelling elements.

We'll also have a separate practical on documenting code which will help us comment and document the framework.

The application will ultimately look like that on the above-right, however, for the first few sessions it'll just print stuff to the command line -- we *will* get to windows, but we need some basics under our belts first.


So, let's get programming.