Returns the horizontal coordinate of the agent’s site for a given place, or of the agent itself.
This function returns the horizontal (
x) coordinate of the agent itself if no argument
is given. Otherwise it returns
the horizontal coordinate of the agent’s site for the given place name. For example,
getx(Workplace) returns the horizontal coordinate of the agent’s specific Workplace site.
The given coordinate is the distance in meters from the western edge of the simulation area, as defined by the locations declared in the simulation block for the program.
The name of a place that the agent can visit.
With no argument, this returns the x-coordinate of the agent itself as a floating point number.
place_name is given, then the x-coordinate of the agent’s site for this place is returned.
The following example retrieves the x-coordinate of the current agent’s household.
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
getx(School) if the current agent does
not attend a school.