Reference 〉Function

Helipad.addGood( str name, str color, num|func(str) endowment = None, bool money = False )

Registers a good that model agents can carry or trade. Agents will keep track of stocks of the good in the agent.stocks dict.


  • name str, required

    The name of the good.

  • color str, required

    A hex value (without the initial #) representing the color that ought to represent the good in the control panel and graphs.

  • endowment num|func(str), optional

    Determines how much of the good agents begin the model with. Can take a number (int or float), or a function that takes the breed as its only argument and returns a number.

    Default value: None

  • money bool, optional

    Sets the good as the medium of exchange for the purpose of functions such as Only one good can be declared the monetary good.

    Default value: False

Return Value Good

The newly created Good object.

Notes and Examples

  1. Contribute a Note

    Your email address will not be published. Required fields are marked *

    You may use limited HTML for formatting. Please embed blocks of code in <pre><code> </code></pre> tags.