ora4mas.nopl
Class GroupBoard
java.lang.Object
cartago.Artifact
ora4mas.nopl.OrgArt
ora4mas.nopl.GroupBoard
- All Implemented Interfaces:
- ToXML
public class GroupBoard
- extends OrgArt
Artifact to manage a group instance.
Operations (see details in method list below):
- adoptRole
- leaveRole
- addScheme
- removeScheme
Observable properties:
- play(ag,role,group): agent ag is playing the role in the group.
- schemes: a list of schemes identification the group is responsible for.
- specification: the specification of the group in the OS (a prolog like representation)
- subgroups: a list of subgroups ids
- parent group: the id of the parent group (used in subgroups)
- formationStatus: whether the group is well-formed (values are ok and nok)
Signals (obligations has the form: obligation(to whom, reason, what, deadline)):
- oblCreated(o): the obligation o is created
- oblFulfilled(o): the obligation o is fulfilled
- oblUnfulfilled(o): the obligation o is unfulfilled (e.g. by timeout)
- oblInactive(o): the obligation o is inactive (e.g. its condition does not hold anymore)
- normFailure(f): the failure f has happened (e.g. due some regimentation violation)
- See Also:
Group
Fields inherited from class ora4mas.nopl.OrgArt |
gui, monitorSchArt, myNPLListener, nengine, orgState, ownerAgent, running, sglDestroyed, sglNormFailure, sglOblCreated, sglOblFulfilled, sglOblInactive, sglOblUnfulfilled, updateGUIThread |
Fields inherited from class cartago.Artifact |
observabilityRadius, position, thisOpId |
Method Summary |
void |
addScheme(java.lang.String schId)
the group starts being responsible for the scheme schId |
void |
admCommand(java.lang.String cmd)
|
void |
adoptRole(java.lang.String role)
The agent executing this operation tries to adopt a role in the group |
void |
destroy()
|
org.w3c.dom.Element |
getAsDOM(org.w3c.dom.Document document)
|
static org.w3c.dom.Element |
getGrAsDOM(Group gr,
java.lang.String spec,
boolean isWellFormed,
java.lang.String owner,
Group root,
org.w3c.dom.Document document)
|
protected java.lang.String |
getStyleSheetName()
|
void |
init(java.lang.String osFile,
java.lang.String grType,
boolean createMonitoring,
boolean hasGUI)
Initialises the group board |
boolean |
isWellFormed()
|
void |
leaveRole(java.lang.String role)
The agent executing this operation tries to give up a role in the group |
void |
removeScheme(java.lang.String schId)
|
void |
setParentGroup(java.lang.String parentGroupId)
|
Methods inherited from class cartago.Artifact |
await_time, await, await, commit, defineObsProperty, defineOp, delay, dispose, dispose, execInternalOp, execLinkedOp, execLinkedOp, failed, failed, getCreatorId, getId, getManualSrcFile, getObservabilityRadius, getObsProperty, getObsPropertyByTemplate, getOpKey, getOpUserId, getOpUserName, getPosition, hasObsProperty, hasObsPropertyByTemplate, isLinked, log, lookupArtifact, makeArtifact, removeObsProperty, removeObsPropertyByTemplate, setupOperations, setupPosition, signal, signal, updateObservabilityRadius, updateObsProperty, updatePosition |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
obsPropSpec
public static final java.lang.String obsPropSpec
- See Also:
- Constant Field Values
obsPropPlay
public static final java.lang.String obsPropPlay
- See Also:
- Constant Field Values
obsPropSchemes
public static final java.lang.String obsPropSchemes
- See Also:
- Constant Field Values
obsPropSubgroups
public static final java.lang.String obsPropSubgroups
- See Also:
- Constant Field Values
obsPropParentGroup
public static final java.lang.String obsPropParentGroup
- See Also:
- Constant Field Values
obsWellFormed
public static final java.lang.String obsWellFormed
- See Also:
- Constant Field Values
GroupBoard
public GroupBoard()
init
public void init(java.lang.String osFile,
java.lang.String grType,
boolean createMonitoring,
boolean hasGUI)
throws ParseException,
MoiseException,
cartago.OperationException
- Initialises the group board
- Parameters:
osFile
- the organisation specification file (path and file name)grType
- the type of the group (as defined in the OS)createMonitoring
- whether a monitoring scheme will be created and attachedhasGUI
- whether a GUI have to be created for the artifact
- Throws:
ParseException
- if the OS file is not correct
MoiseException
- if grType was not specified
cartago.OperationException
- if parentGroupId doesn't exit
destroy
public void destroy()
- Overrides:
destroy
in class OrgArt
setParentGroup
public void setParentGroup(java.lang.String parentGroupId)
throws cartago.OperationException
- Throws:
cartago.OperationException
adoptRole
public void adoptRole(java.lang.String role)
- The agent executing this operation tries to adopt a role in the group
- Parameters:
role
- the role being adopted
leaveRole
public void leaveRole(java.lang.String role)
- The agent executing this operation tries to give up a role in the group
- Parameters:
role
- the role being removed/leaved
addScheme
public void addScheme(java.lang.String schId)
- the group starts being responsible for the scheme schId
removeScheme
public void removeScheme(java.lang.String schId)
admCommand
public void admCommand(java.lang.String cmd)
throws cartago.CartagoException,
jason.asSyntax.parser.ParseException
- Throws:
cartago.CartagoException
jason.asSyntax.parser.ParseException
getStyleSheetName
protected java.lang.String getStyleSheetName()
- Specified by:
getStyleSheetName
in class OrgArt
isWellFormed
public boolean isWellFormed()
getAsDOM
public org.w3c.dom.Element getAsDOM(org.w3c.dom.Document document)
getGrAsDOM
public static org.w3c.dom.Element getGrAsDOM(Group gr,
java.lang.String spec,
boolean isWellFormed,
java.lang.String owner,
Group root,
org.w3c.dom.Document document)