EcoLab: Agent Based Modeling for C++ programmers

16 downloads 0 Views 78KB Size Report
Feb 1, 2008 - vided by Australian Centre for Advanced Computing and Communications (ac3) for supporting different operating systems and testing parallel ...
arXiv:cs/0401026v1 [cs.MA] 27 Jan 2004

EcoLab: Agent Based Modeling for C++ programmers Russell K. Standish and Richard Leow High Performance Computing Support Unit University of New South Wales, Sydney 2052, Australia {R.Standish,R.Leow}@unsw.edu.au http://parallel.hpc.unsw.edu.au/ecolab February 1, 2008 Abstract EcoLab is an agent based modeling system for C++ programmers, strongly influenced by the design of Swarm. This paper is just a brief outline of EcoLab’s features, more details can be found in other published articles, documentation and source code from the EcoLab website.

1

EcoLab

EcoLab is an ABM system for C++ programmers. This is not the time or place to debate the merits of C++ over any other object oriented language. If you have chosen C++ as an implementation language for your models because of performance, expressibility, familiarity or compatibility with other software libraries, then ABM environments such as Swarm or Repast offer little support to you. In this case, you should consider EcoLab.

2

Scripting

EcoLab uses the Classdesc[2] object descriptor technology. This provides a form of object reflection, or the ability to query an object’s internal structure at runtime. This may seem obvious to a Java or Objective C programmer, as object reflection is built into the language. How is Classdesc used in EcoLab? The user codes their entire model as a class. Usually, there will only be one instantiated object of that class (the model). Most model instance variables, and model methods adhering to particular calling conventions are exposed to a TCL interpreter. This allows great flexibility to 1

configure different sorts of experiments at runtime. For example, if your model class is: class model_t { public: int tstep; double foo; void step(); double average_something(); } model; then by inserting the macro call make_model(model) into your code, the following TCL script is possible: model.tstep 0 model.foo 0 while {[model.tstep]