A statistics library for discrete-event agent-based modelling. Meant to be usable by any Java-based modelling framework (e.g. AnyLogic, Repast) as well as standalone models written in Java, Scala, Clojure, etc.
To use the library, a model needs the following:
- Java classes for
- the model as a whole
- every agent that you want statistics to be collected over
- every event that you want statistics to be collected over (must be immutable / value objects), and an
Event
type that is a supertype of all the event classes
- A globally accessible model time
- Before running the model
- Create an instance of
ABMStats
. - Add specific statistics collectors to it using the
addAgentCollector
andaddEventCollector
methods. - Store the instance somewhere globally accessible in the model
- As the model runs
- Call
timeChanged
on theABMStats
instance whenever the model time changes, or periodically depending on the AgentStatisticsCollectors added in 1.2 - Call
event
on theABMStats
instance whenever an event occurs that you wish to track
- After the model terminates
- use any of the export methods to get the data from the
ABMStats
instance (currently onlyexportToSpreadsheet
)
Same as above, but replace step 1.1 and 1.2 by calling the constructor of THIMStats
with the appropriate parameters.