Skip to content

Class Structure

JD edited this page Jan 7, 2023 · 4 revisions

Class Structure

Class structure UML diagram

Class Diagram

This is the standard class layout of this software. As you can see, the World class is in the center of everything. This is because it controls the flow of every experiment that is executed. The Matchup Generator, the Optimizer and the Payoff Calculator each represent a step in every round of play. The Grid is necessary to store organisms and, if implemented, their spatial information. The archiver and the Visualizer are used to get a useable output from experiments. The visualisation is a optional part of the system and usually implemented in a fast data processing script outside of C++.

The three standard classes used by the Optimizer are the Selector, the Repopulator and the Mutator. The Optimizer packs these three steps from the end of a round into one managing class, to improve the modularity of the whole system. This means that these components can be optional for a different, non-standard Optimizer (as can be the case for a mutator in spatial public goods games) and the World class does not need to know about the details of the implementation.

Base Classes

Each of these classes and components, except the World class at the moment, is designed to be swapable with a different implementation. This allows new functionality to be added without requiring changes in the flow of the system. This means each base class has to assume certain ways data is transfered in the flow of the World class, the details of this are documented in each of the base class articles.