Class Organization

java.lang.Object
madkit.kernel.Organization

public final class Organization extends Object
This class is responsible for managing the organization of the artificial society. It is responsible for creating and removing communities, groups and roles.
  • Method Details

    • isGroup

      public boolean isGroup(String community, String group)
      Returns true if the group exists in the organization. A group exists if it has at least one agent playing a role in it.
      Parameters:
      community - the community name
      group - the group name
      Returns:
      true if the group exists
    • isRole

      public boolean isRole(String community, String group, String role)
      Returns true if the role exists in the organization. A role exists if it has at least one agent playing it.
      Parameters:
      community - the community name
      group - the group name
      role - the role name
      Returns:
      true if the role exists
    • 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 name
      group - the group name
      role - the role name
      Returns:
      the role object
      Throws:
      madkit.kernel.CGRNotAvailable
    • getGroup

      public Group getGroup(String community, String group) throws madkit.kernel.CGRNotAvailable
      Returns the group object corresponding to the given community and group names
      Parameters:
      community - the community name
      group - the group name
      Returns:
      the group object corresponding to the given community and group names
      Throws:
      madkit.kernel.CGRNotAvailable
    • isCommunity

      public boolean isCommunity(String community)
      Returns true if 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:
      true if the community exists
    • removeCommunity

      public void removeCommunity(String community)
      Parameters:
      community -
    • getCommunities

      public List<Community> getCommunities()
      Returns a list of all the communities in the organization
      Returns:
      the list of communities in the organization
    • getAgentsWithRole

      public List<AgentAddress> getAgentsWithRole(String community, String group, String role)
      Returns a List containing all other agents having this position in the organization. The caller is excluded from the search.
      Parameters:
      community - the community name
      group - the group name
      role - the role name
      Returns:
      a list of agent addresses corresponding to agents having the given role