|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gov.nasa.arc.brahms.common.data.BrahmsObject gov.nasa.arc.brahms.common.data.ModelElement gov.nasa.arc.brahms.common.data.Condition gov.nasa.arc.brahms.common.data.Detectable
public class Detectable
A detectable is a declarative statement defining first which state changes an agent or object can detect and second what action results from detecting the state change.
Detecting facts is a two-step process. In the first step the agent or object detects the fact and the fact becomes a belief for the agent or object. No matter what the right hand side is in the form OA=V and OA=O the fact will become a belief for the agent or object. The second step is different for agents and objects. For agents in the second step the beliefs of the agent are matched with the detectable definition and if there is a positive match, the detectable action is executed. For objects in the second step the facts in the world are matched with the detectable definition and if there's a positive match, the detectable action is executed.
Note that these two steps are independent for agents, i.e. regardless of whether the fact is present in the world, the second step is performed. This means that if the agent has received a matching belief through a communication, the belief will trigger the action of the detectable. For objects this is irrelevant since it only performs the action based on the fact in the world which is also used in the first step.
Field Summary |
---|
Fields inherited from interface gov.nasa.arc.brahms.common.IConstants |
---|
ABORT, ACTIVECLASS, ACTIVECONCEPT, ACTIVEINSTANCE, AGENT, ANONYMOUS, ANYAGENT, AREA, AREADEF, ASSIGNED, ATTRIBUTE, BASEAREADEF, BASECLASS, BASECONCEPTUALCLASS, BASEGROUP, BASELIBRARY, BOOLEAN, BROADCAST, BUILDING, BYTE, CCLOCK, CDATE, CHAR, CITY, CLASS, CLOCK, COLLECTALL, COMMUNICATE, COMPLETE, COMPOSITE, COMPUTER, CONCEPT, CONCEPTUALCLASS, CONCEPTUALCONCEPT, CONCEPTUALOBJECT, CONTINUE, COPY, CREATEAGENT, CREATEAREA, CREATEOBJECT, current, CURRENT, DATAFRAME, DATE, DB, DETECTABLE, DIV, DOUBLE, EMAIL, EMPTY_STRING, END, ENDACTIVITY, ENTAGENT, EQ, EXCEPTION, EXPR, FACE2FACE, FACTFRAME, FALSE, FAX, FLOAT, FOREACH, FORONE, G2, GE, GEOGRAPHYCONCEPT, GESTURE, GET, GROUP, GT, IMPASSE, INT, INVALID, JAVA, JAVA_TYPE, KNOWN_MODIFIER, KNOWNVAL_MODIFIER, LE, LOCAL, LONG, LT, MAP, MINUS, MOD, MOVE, MULT, NE, NEW, NONE, NOT_MODIFIER, NOWORK, O, OA, OBJECT, ONTOLOGY, PAGER, PARAMETER, PATH, PHONE, PLUS, PRIMITIVE, PRIVATE, PROAGENT, PROTECTED, PRSAGENT, PUBLIC, PUT, RECEIVE, RELATION, sACTIVECLASS, sACTIVECONCEPT, sACTIVEINSTANCE, sAGENT, sARCHIVE, sAREA, sAREADEF, sBOOLEAN, sBYTE, sBYTECODEEXT, sCHAR, sCLASS, sCOMPUTER, sCONCEPT, sCONCEPTUALCLASS, sCONCEPTUALCONCEPT, sCONCEPTUALOBJECT, sCOPY, sCURRENT, sDETECTABLE, sDOUBLE, sEMAIL, sEND, SEND, sFACE2FACE, sFAX, sFILEEXT, sFLOAT, sGEOGRAPHYCONCEPT, sGROUP, SHORT, SIMAGENT, sINT, sJAVA_TYPE, sLONG, sMAP, sNEW, sNONE, sNOWORK, sOBJECT, SOURCECODE, sPAGER, sPARAMETER, sPATH, sPHONE, sPRIVATE, sPROJECTEXT, sPROTECTED, sPUBLIC, sSHORT, sSTART, sSTRING, sSYMBOL, START, STRING, sUNKNOWN, sVOID, SYMBOL, TRUE, UDT, UML, UNASSIGNED, UNDEFINED, unknown, UNKNOWN, UNKNOWN_MODIFIER, V, VARIABLE, VOID, WHENEVER, WORKFRAME, WORLD, XML |
Constructor Summary | |
---|---|
Detectable()
Constructor, creates a new detectable. |
|
Detectable(java.lang.String name)
Constructor, creates a new detectable with the specified name. |
|
Detectable(java.lang.String name,
Comparison c)
Constructor, create a new detectable with the specified name and the specified comparison specifying the condition to be detected. |
|
Detectable(java.lang.String name,
Comparison c,
int truth)
Constructor, create a new detectable with the specified name and the specified comparison and truth value specifying the condition to be detected. |
Method Summary | |
---|---|
IDetectableCtx |
createContext()
Creates a new context for this detectable. |
int |
getAction()
Returns the action to be performed when the detectable's condition exactly matches with an asserted belief (in case of an agent) or fact (in case of an object). |
int |
getCertainty()
Returns the certainty that the detectable detects a fact. |
java.lang.String |
getFullyQualifiedName()
Returns the fully qualified name of the detectable. |
java.lang.String |
getName()
Returns the name of the detectable. |
int |
getWhen()
Returns when the detectable is to be activated. |
void |
setAction(int action)
Sets the action to be performed when the detectable's condition exactly matches with an asserted belief (in case of an agent) or fact (in case of an object). |
void |
setCertainty(int certainty)
Sets the certainty that the detectable detects a fact. |
protected void |
setID()
Sets the unique identifier. |
void |
setName(java.lang.String name)
Sets the name of the detectable. |
void |
setWhen(int when)
Sets when the detectable is to be activated. |
java.lang.String |
toString()
Returns the string representation of the detectable |
Methods inherited from class gov.nasa.arc.brahms.common.data.Condition |
---|
getComparison, getOwner, getParameters, getTruthValue, getTruthValueAsString, getVariables, setComparison, setOwner, setOwner, setOwner, setTruthValue, toSource |
Methods inherited from class gov.nasa.arc.brahms.common.data.BrahmsObject |
---|
delete, export, getFile, getID, getLine, getSerialNumber, isBCC, isDynamic, isLoaded, isResolved, setBCC, setDynamic, setFile, setID, setLine, setLoaded, setResolved, setSerialNumber |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Detectable()
public Detectable(java.lang.String name)
name
- the name for the detectablepublic Detectable(java.lang.String name, Comparison c)
name
- the name for the detectablec
- the Comparisonpublic Detectable(java.lang.String name, Comparison c, int truth)
name
- the name for the detectablec
- the Comparisontruth
- the truth-value of the conditionMethod Detail |
---|
protected void setID()
setID
in class BrahmsObject
public void setName(java.lang.String name)
name
- the name of the detectablepublic java.lang.String getName()
public void setWhen(int when)
when
- WHENEVER or a positive integer specifying the time passed
before the detectable is to be activatedIConstants.WHENEVER
public int getWhen()
IConstants.WHENEVER
public void setCertainty(int certainty)
certainty
- the certainty percentagepublic int getCertainty()
public void setAction(int action)
action
- the detectable's actionIConstants.CONTINUE
,
IConstants.IMPASSE
,
IConstants.COMPLETE
,
IConstants.ABORT
,
IConstants.ENDACTIVITY
public int getAction()
IConstants.CONTINUE
,
IConstants.IMPASSE
,
IConstants.COMPLETE
,
IConstants.ABORT
,
IConstants.ENDACTIVITY
public java.lang.String getFullyQualifiedName()
public IDetectableCtx createContext()
Note: This method always returns a new instance and does not verify whether one is already created.
public java.lang.String toString()
toString
in class Condition
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |