Class Organization
java.lang.Object
madkit.kernel.Organization
This class is responsible for managing the organization of the artificial society. It
is responsible for creating and removing communities, groups and roles.
-
Method Summary
Modifier and TypeMethodDescriptiongetAddressOfAgentAt(Agent agent, String community, String group, String role) Returns the address of the given agent playing the given role in the given groupgetAgentsWithRole(String community, String group, String role) Returns aListcontaining all other agents having this position in the organization.Returns a list of all the communities in the organizationgetCommunity(String community) Gets the community object corresponding to the given community name.Returns the group object corresponding to the given community and group namesfinal OrganizationSnapshotgetOrganizationSnapShot(boolean global) Returns a snapshot of the current organization structure.Returns the role object corresponding to the given community, group and rolebooleanisCommunity(String community) Returnstrueif the community exists in the organization.booleanReturnstrueif the group exists in the organization.booleanReturnstrueif the role exists in the organization.voidremoveCommunity(String community)
-
Method Details
-
isGroup
-
isRole
-
getRole
public Role getRole(String community, String group, String role) throws madkit.kernel.CGRNotAvailable Returns the role object corresponding to the given community, group and role- Parameters:
community- the community namegroup- the group namerole- the role name- Returns:
- the role object
- Throws:
madkit.kernel.CGRNotAvailable
-
getCommunity
-
getGroup
Returns the group object corresponding to the given community and group names- Parameters:
community- the community namegroup- the group name- Returns:
- the group object corresponding to the given community and group names
- Throws:
madkit.kernel.CGRNotAvailable
-
isCommunity
Returnstrueif the community exists in the organization. A community exists if it has at least one agent playing a role in a group.- Parameters:
community- the community name- Returns:
trueif the community exists
-
removeCommunity
- Parameters:
community-
-
getCommunities
-
getAgentsWithRole
Returns aListcontaining all other agents having this position in the organization. The caller is excluded from the search.- Parameters:
community- the community namegroup- the group namerole- the role name- Returns:
- a list of agent addresses corresponding to agents having the given role
-
getOrganizationSnapShot
Returns a snapshot of the current organization structure.- Parameters:
global- include distant groups and roles if true- Returns:
- a snapshot of the current organization structure
-
getAddressOfAgentAt
Returns the address of the given agent playing the given role in the given group- Parameters:
agent- the agent to look forcommunity- the community namegroup- the group namerole- the role name- Returns:
- the address of the agent playing the given role or
nullif the agent does not play this role
-