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
nwhen 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