Package jadex.extension.agr
Class Group
- java.lang.Object
-
- jadex.extension.agr.Group
-
public class Group extends java.lang.Object
An AGR group hold information about agent instances and their positions (i.e. role instances).
-
-
Constructor Summary
Constructors Constructor Description Group(java.lang.String name)
Create a new group.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Get the name of the group.- Returns:
- The group name.
-
addRoleForType
public void addRoleForType(java.lang.String typename, java.lang.String rolename)
Add a role name for an agent type name.- Parameters:
typename
- The agent type name.rolename
- The role name.
-
removeRoleForType
public void removeRoleForType(java.lang.String typename, java.lang.String rolename)
Remove a role name for an agent type name.- Parameters:
typename
- The agent type name.rolename
- The role name.
-
getRolesForType
public java.lang.String[] getRolesForType(java.lang.String typename)
Get the role names for an agent type name.- Parameters:
typename
- The agent type name.- Returns:
- The role names (if any).
-
assignRole
public void assignRole(IComponentIdentifier aid, java.lang.String rolename)
Assign an agent to a role.- Parameters:
aid
- The agent id.rolename
- The role name.
-
unassignRole
public void unassignRole(IComponentIdentifier aid, java.lang.String rolename)
Remove an agent from a role.- Parameters:
aid
- The agent id.rolename
- The role name.
-
getAgentsForRole
public IComponentIdentifier[] getAgentsForRole(java.lang.String rolename)
Get the agents with a given role.- Parameters:
rolename
- The role name.
-
-