Reference 〉 Hook

match(agentslist[Agent], primitivestr, modelHelipad, stageint)

Code to be performed in a matching model, when model.order or the order parameter of the relevant primitive has been set to 'match' or 'match-n'. Helipad steps agents in groups of n and passes them to the match hook. The hook does not run otherwise.

The match hook will run once per primitive per stage. Corresponding per-primitive hooks are also available on the pattern [primitive]Match, e.g. bankMatch would run only during the matching process of 'bank'-primitive agents. See Agents.addPrimitive().

Required Parameters

  • agents list[Agent]

    The agents being matched. The length of this list is n when the order is 'match-n', or 2 when the order is 'match' without the -n.

  • primitive str

    The primitive of the agents being currently matched.

  • model Helipad

    The model object.

  • stage int

    The current stage of the model.

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.

History