Class Community

java.lang.Object
madkit.kernel.Community

public class Community extends Object
This class represents a community within the MaDKit kernel. It is meant to be a namespace for groups and roles, so that a specific AGR organization can be instantiated within a community, and thus isolated from others, avoiding conflicts.

It provides methods to query which groups and roles are available in the community,

See Also:
  • Method Details

    • getName

      public String getName()
      Returns the name of the community.
      Returns:
      the name of the community
    • getLogger

      public Logger getLogger()
      Returns the logger associated with the community.
      Returns:
      the logger associated with the community
    • getGroup

      public Group getGroup(String name) throws madkit.kernel.CGRNotAvailable
      Returns the group with the specified name.
      Parameters:
      name - the name of the group
      Returns:
      the group with the specified name
      Throws:
      madkit.kernel.CGRNotAvailable - if the group is not available
    • getGroups

      public List<Group> getGroups()
      Returns a list of all groups in the community.
      Returns:
      a list of all groups in the community
    • removeAgent

      public void removeAgent(Agent agent)
      Removes the specified agent from all groups in the community.
      Parameters:
      agent - the agent to remove
    • size

      public int size()
      Returns the number of groups in the community.
      Returns:
      the number of groups in the community
    • exists

      public boolean exists()
      Checks if the community exists (i.e., has any groups).
      Returns:
      true if the community has any groups, false otherwise