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 baseAgent
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 Agent
s 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 theShocks.do()
method. Instead ofShocks.do(name)
, useShocks[name].do(model)
. - ⚠️ baseAgent
agent.goods
renamed toagent.stocks
to avoid a conflict withmodel.goods
in multi-level models. - ⚠️ ParamConverted to an
Item
object rather than adict
- ⚠️ PrimitiveConverted to an
Item
object rather than adict
- ⚠️ ShockConverted to an
Item
subclass rather than adict
, and added the.do()
method to replaceShocks.do()
. - Helipad
model.name
introduced - removePrimitiveIntroduced.
- agentReporterDefault for
prim
argument changed from'agent'
toNone
- summaryDefault for
prim
argument changed from'agent'
toNone
- MultiLevelIntroduced.