gov.nasa.arc.brahms.vm.api.common
Interface IGroup

All Superinterfaces:
IActiveClass, IActiveConcept, IConcept, IType, IUserDefinedType

public interface IGroup
extends IActiveClass

The concept of a "group" in Brahms is similar to the concept of a template or class in object-oriented programming. A group represents a collection of 'agents' that can perform similar work and have similar beliefs. A group defines the work activities (activity frames and thought frames), the initial-beliefs of members in the group and the initial-facts in the world. The difference with classes in object-oriented programming is that the relationship between a group and its members is not an IS-A relationship, but a MEMBER-OF relationship. This is why we speak of "a member of a group" instead of "an instance of a group."

Version:
$Revision: 1.1 $ $Date: 2009/11/23 18:38:31 $ $Author: rnado $
Author:
Ron van Hoof
See Also:
IActiveClass

Field Summary
 
Fields inherited from interface gov.nasa.arc.brahms.vm.api.common.IUserDefinedType
UDT
 
Method Summary
 java.util.List<IAgent> getMembers(boolean includeMemberGroups)
          Returns a list of all of this group's member agents.
 IAgent newAgent(java.lang.String name, IContext actionCtx)
          newAgent creates a new agent, makes it a member of this group and returns the new agent.
 
Methods inherited from interface gov.nasa.arc.brahms.vm.api.common.IActiveConcept
hasThoughtframes, hasWorkframes
 
Methods inherited from interface gov.nasa.arc.brahms.vm.api.common.IConcept
getAttribute, getAttributes, getRelation, getRelations, isLocal
 
Methods inherited from interface gov.nasa.arc.brahms.vm.api.common.IType
getName, getType
 

Method Detail

newAgent

IAgent newAgent(java.lang.String name,
                IContext actionCtx)
                throws ExternalException
newAgent creates a new agent, makes it a member of this group and returns the new agent. The new agent is given the specified name. If the name already exists a unique number will be attached to the name.

Parameters:
name - the name of the new agent
actionCtx - the IContext for the action
Returns:
IAgent the new agent being a member of this group
Throws:
ExternalException - if the creation of the new agent fails

getMembers

java.util.List<IAgent> getMembers(boolean includeMemberGroups)
                                  throws ExternalException
Returns a list of all of this group's member agents. If includeMemberGroups is set to true it will also include all the agents that are members of the groups that are members of this group.

Parameters:
includeMemberGroups - true to include member agents of member groups, false to only return agents that are direct members of this group
Returns:
List the list of member agents, an empty list if there are none
Throws:
ExternalException - if an internal error occurs


Copyright © 1997-2012 All Rights Reserved.