Abstract
This chapter provides the reader with a practical introduction to agent-based modeling, via the Repast Simphony programming environment. Using examples of agent-based models from an earlier chapter, we look in detail at how to build models via either flowcharts or Java code. We illustrate some of the ways in which a toolkit such as Repast considerably simplifies the life of the modeler by providing extensive support for model visualization, charting of results, and multiple runs, for instance.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
Strictly speaking, the sorts of agents we shall be concerning ourselves with are called proto-agents in Repast S, where the term agent is reserved for proto-agents that exhibit learning behavior. However, for the sake of consistency with the rest of this book we will not use the term proto-agent.
- 2.
Eclipse should, of course, already have the Repast Simphony plug-ins installed. This version is available from the Repast Simphony web site.
- 3.
Not to be confused with the Properties tab that is used to set values for things like the Label property of contexts and projections.
- 4.
Although note that “agent field” should really be “property” in Repast terminology.
- 5.
Of course, the intermediate variable x could have been avoided altogether by using RandomDraw() directly in its place in the second task.
- 6.
It may be worth noting that it is not necessary in Java to use a get- or set-method when objects of the same type access each other’s properties, regardless of whether they are private or not.
- 7.
Note that when specifying projection positions, the order of parameters should be x then y then z.
- 8.
As we noted in the discussion of Properties in Sect. 3.1, one of the disadvantages of using Only Me as a visibility is that it prevents this kind of useful inspection, as well as editing of agent states.
- 9.
Inheritance is an important and distinctive feature of OO languages. The reader unfamiliar with these concepts should consult an introductory text, such as that by Barnes and Kölling [2].
- 10.
The approach is slightly different in the case of a Network projection as a NetworkBuilder is used instead. The full Repast S documentation provides the detail.
- 11.
If further infectable agents were to be added at some point it would be easy to forget to add knowledge of their distinctive infection periods into InfectableAgent, for instance.
- 12.
Remember to save the Scenario Tree after doing this, otherwise this setting will be lost.
- 13.
A singleton class permits at most one instance of the class to be created.
- 14.
Rather confusingly, a stepped sequence is referred to as a number.
References
Barnes, D.J., Kölling, M.: Objects First with Java—A Practical Introduction Using BlueJ, 4th edn. Pearson Education, London (2008)
Foundation, E.: Eclipse integrated development environment (2010). URL http://www.eclipse.org/
Groovy: Groovy—an agile dynamic language for the java platform (2010). URL http://groovy.codehaus.org/
RepastS: Repast agent simulation toolkit (2010). URL http://repast.sourceforge.net/
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
Copyright information
© 2010 Springer-Verlag London Limited
About this chapter
Cite this chapter
Barnes, D.J., Chu, D. (2010). ABMs Using Repast and Java. In: Introduction to Modeling for Biosciences. Springer, London. https://doi.org/10.1007/978-1-84996-326-8_3
Download citation
DOI: https://doi.org/10.1007/978-1-84996-326-8_3
Publisher Name: Springer, London
Print ISBN: 978-1-84996-325-1
Online ISBN: 978-1-84996-326-8
eBook Packages: Computer ScienceComputer Science (R0)