gety¶
Syntax¶
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.
If place_name is given, then the y-coordinate of the agent's site for this place is returned.
Description¶
This action 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.
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.
Examples¶
The following example retrieves the y-coordinate of the current agent's household.