Reference 〉Hook

buy( Agent agent, Agent partner, str good, num q, num p )

Runs when an agent purchases a good with money and allows the quantity passed to the function to be modified.

Required Parameters

  • agent Agent

    The agent initiating the purchase.

  • partner Agent

    The trading partner of the agent.

  • good str

    The name of the good being purchased.

  • q num

    The quantity of the good being purchased.

  • p num

    The per-unit price at which the good was purchased. The purchase will involve an outlay of p*q.

Expected Return Value tuple(num,num)

If specified, overrides the price and quantity, respectively, originally initiated.

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.