public class Group
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
name
The group name.
|
protected java.util.Map |
positions
The positions (role name -> Set{aids}).
|
protected java.util.Map |
roles
The roles (agent type name -> Set{role names}).
|
Constructor and Description |
---|
Group(java.lang.String name)
Create a new group.
|
Modifier and Type | Method and Description |
---|---|
void |
addRoleForType(java.lang.String typename,
java.lang.String rolename)
Add a role name for an agent type name.
|
void |
assignRole(IComponentIdentifier aid,
java.lang.String rolename)
Assign an agent to a role.
|
IComponentIdentifier[] |
getAgentsForRole(java.lang.String rolename)
Get the agents with a given role.
|
java.lang.String |
getName()
Get the name of the group.
|
java.lang.String[] |
getRolesForType(java.lang.String typename)
Get the role names for an agent type name.
|
void |
removeRoleForType(java.lang.String typename,
java.lang.String rolename)
Remove a role name for an agent type name.
|
void |
unassignRole(IComponentIdentifier aid,
java.lang.String rolename)
Remove an agent from a role.
|
protected java.lang.String name
protected java.util.Map positions
protected java.util.Map roles
public Group(java.lang.String name)
type
- The group type.public java.lang.String getName()
public void addRoleForType(java.lang.String typename, java.lang.String rolename)
typename
- The agent type name.rolename
- The role name.public void removeRoleForType(java.lang.String typename, java.lang.String rolename)
typename
- The agent type name.rolename
- The role name.public java.lang.String[] getRolesForType(java.lang.String typename)
typename
- The agent type name.public void assignRole(IComponentIdentifier aid, java.lang.String rolename)
aid
- The agent id.rolename
- The role name.public void unassignRole(IComponentIdentifier aid, java.lang.String rolename)
aid
- The agent id.rolename
- The role name.public IComponentIdentifier[] getAgentsForRole(java.lang.String rolename)
rolename
- The role name.