group_id()
Returns the ID of the group agent of a group.
Synopsis
group_id(group_name)
group_id(unique_group_id)
Description
The first form returns the ID the group agent for the executing agent’s group.
Returns 0
if the agent is not a member of the given group, or if
the group does not have an group agent.
The second form returns the ID the group agent for the group
whose unique group_id is provided.
Returns 0
if the argument is not the ID of a group, or if
the group does not have an group agent.
Parameters
group_name
A valid group name.
unique_group_name
Expression that evaluates to a valid unique group ID.
Returns
Returns either the ID of an group agent or 0
if the agent
is not a member of the given groop, or the argument is not a valid
group ID, or if the group does not have an group agent.
Notes
All group agents have IDs , 0
, so the value of 0
indicates a missing repsonse.
Examples
Suppose the model declares that each school has an group agent. The the following would return the ID of the group agent for the student’s specific school.
place School {
has_group_agent = 1
}
my_school_group_agent = group_id(School)