Determines agent position on the launch of a spatial model. If not specified, agents are randomly positioned. In a spatial model, this hook runs for every primitive except patches, which have a fixed position.
Required Parameters
agent — Agent
The agent object to be positioned.
model — Helipad
The model object
Expected Return Value — tuple(num, num)
A list or tuple with the (x,y) coordinates of the agent's initial position.
charwick
May 26, 2023 at 6:05If the spatial model has been initialized with
offmap=False
, this hook must return a position on a live patch, or aValueError
will be raised. This can be avoided by checkingPatches.at()
, which returnsNone
if there is no patch under a coordinate.