News 〉Releases

Helipad 0.6 supports multi-level modeling

Helipad 0.6 supports multi-level agent-based modeling, where the agents at one level are themselves full models. Simply register a primitive with the new Helipad.MultiLevel object, which inherits properties from both the Agent and Helipad classes.

To demonstrate the new feature, a new sample model of group selection for altruism is included, based on Bowles and Gintis (2011, ch.7): selfish agents are selected for within demes, but altruistic agents are selected in competition between demes. The demes are instantiated with the new MultiLevel object, and contain Agents of their own.

Notice also in this screenshot the window titles. One minor nicety introduced in 0.6 is the ability to name the model by setting model.name, which allows the GUI’s window titles to be customized.

One important backward-incompatible change is that Agent.goods has been renamed to Agent.stocks. Because MultiLevel inherits from both Helipad and baseAgent, the fact that model.goods and Agent.goods were doing different things was causing problems. If you were using the goods API, be sure to update the property name in your code.

Finally, some internal data structures have been simplified and rearchitected in order to provide more flexibility for future functionality. If you were accessing parameter, primitive, or shock data directly (which is not recommended), be aware that the structure has been changed.

A complete list of API changes is below.

API Changes in Version 0.6

  • ⚠️ ShocksAdded the Shock class as a property, and removed the Shocks.do() method. Instead of Shocks.do(name), use Shocks[name].do(model).
  • ⚠️ Agentagent.goods renamed to agent.stocks to avoid a conflict with model.goods in multi-level models.
  • ⚠️ ParamConverted to an Item object rather than a dict
  • ⚠️ PrimitiveConverted to an Item object rather than a dict
  • ⚠️ ShockConverted to an Item subclass rather than a dict, and added the .do() method to replace Shocks.do().
  • Helipadmodel.name introduced
  • removePrimitiveIntroduced.
  • agentReporterDefault for prim argument changed from 'agent' to None
  • agentDefault for primitive argument changed from 'agent' to None
  • summaryDefault for prim argument changed from 'agent' to None
  • MultiLevelIntroduced.