gety()
Returns the vertical coordinate of the agent’s site for a given place, or of the agent itself.
Synopsis
gety(place_name)
Description
This function returns the vertical (y
) coordinate of the agent itself if no argument
is given. Otherwise it returns
the vertical coordinate of the agent’s site for the given place name. For example,
gety(Workplace)
returns the vertical coordinate of the agent’s specific Workplace site.
The given coordinate is the distance in meters from the southern edge of the simulation area, as defined by the locations declared in the simulation block for the program.
Parameters
place_name
The name of a place that the agent can visit.
Returns
With no argument, this returns the y-coordinate of the agent itself as a floating point number.
If place_name
is given, then the y-coordinate of the agent’s site for this place is returned.
Examples
The following example retrieves the y-coordinate of the current agent’s household.
gety(Household)
Errors
If the current agent is not a member of the given place, then an error will occur.
For example, it is an error to call gety(School)
if the current agent does
not attend a school.