Sets self.utility
to the value returned from self.calculate()
. The agent.stocks
dict can be passed directly to this function.
Parameters
quantities — dict{str:num}, required
The quantities of the goods to be consumed. If the utility function was registered with the same set of goods as the model (see
Goods.add()
),agent.stocks
can be passed straight into this function.
Return Value — num
The utility gained from consuming the quantities in question.
Notes and Examples