The big feature of 0.5 is core support for matching models. A matching model doesn’t step through the agents one by one, but matches them together in a group of some number. This is especially useful for game-theoretic models, where agents are paired together and play a strategy against one another.
A matching model can be built by setting
model.order=='match-n', where n is the size of the matched group. Agents will still run their step function if one is specified, but the main model logic will go in a new match function. There are also new hooks to control the matching process more precisely.
The second important improvement is a series of new GUI hooks that allow panels to be inserted at any point in the control panel. See
All of these features are shown off in a new Axelrod tournament model from the classic Axelrod (1980) paper, included in the sample models. In the Axelrod model, agents are paired off and play 200 rounds of a repeated prisoner’s dilemma against each other in order to compare how well various strategies do against a variety of others. This model also uses
GUIAbovePlotList to insert a
checkGrid in the control panel that toggles the various available strategies.
See below for a full list of API changes.
API Changes in Version 0.5
- ⚠️ DataChanged
dictof functions to a dict of
Itemobjects in order to organize more reporter metadata. Code calling reporters directly from the
data.reporters[name](model)should now call them as follows:
- ⚠️ CESEliminated the third
__init__argument and allowed coefficients to be specified in the first argument.
- ⚠️ CobbDouglasEliminated the second
__init__argument and allowed exponents to be specified in the first argument.
- ⚠️ terminatePass the model data as the second argument.
- ⚠️ orderRun the hook at the beginning of each stage rather than each period, and convert to a modified key function.
- ⚠️ dataCollectMoved to before data collection rather than after, as it was functionally equivalent to
- addPrimitiveAdded the
model.ordercan now be set to a list of values corresponding to the number of stages, and also supports matching models.
GUI.checksis now a checkGrid widget rather than a dict.
- textCheckAdded the