|
||||||||||
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 gov.nasa.arc.brahms.vm.data.VMDetectable
public class VMDetectable
A VMDetectable is a Detectable with extensions for use in the Brahms virtual machine. 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.
Detectable
,
Serialized FormField 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 | |
---|---|
VMDetectable()
Constructor, creates a new detectable. |
|
VMDetectable(java.lang.String name)
Constructor, creates a new detectable with the specified name. |
|
VMDetectable(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. |
|
VMDetectable(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. |
java.util.Enumeration |
getMatchingFacts(VMActiveInstanceCtx agent,
VMFrameCtx frame)
Returns a list of all the facts that match with the detectable's condition by just comparing the facts with the left hand side of the detectable condition. |
VMBeliefCtx |
matchesBelief(VMActiveInstanceCtx agent,
VMFrameCtx frame)
Checks whether any of the beliefs in the specified agent's belief set match with this detectable. |
boolean |
matchesBelief(VMBeliefCtx belief,
VMActiveInstanceCtx agent,
VMFrameCtx frame)
Checks whether the specified belief matches with this detectable. |
boolean |
matchesFact(VMFactCtx fact,
VMActiveInstanceCtx agent,
VMFrameCtx frame)
Checks whether the specified fact matches the detectable condition by only considering the left hand side of the detectable condition. |
Methods inherited from class gov.nasa.arc.brahms.common.data.Detectable |
---|
getAction, getCertainty, getFullyQualifiedName, getName, getWhen, setAction, setCertainty, setID, setName, setWhen, toString |
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 VMDetectable()
public VMDetectable(java.lang.String name)
name
- the name for the detectablepublic VMDetectable(java.lang.String name, Comparison c)
name
- the name for the detectablec
- the Comparisonpublic VMDetectable(java.lang.String name, Comparison c, int truth)
name
- the name for the detectablec
- the Comparisontruth
- the truth-value of the condition (TRUE, FALSE, UNKNOWN)IConstants.TRUE
,
IConstants.FALSE
,
IConstants.UNKNOWN
Method Detail |
---|
public java.util.Enumeration getMatchingFacts(VMActiveInstanceCtx agent, VMFrameCtx frame)
agent
- the agent for whom the detectable is checkedframe
- the frame in which the detectable is fired and containing the variable contexts
public boolean matchesFact(VMFactCtx fact, VMActiveInstanceCtx agent, VMFrameCtx frame)
fact
- the fact to be testedagent
- the agent for whom the detectable is checkedframe
- the frame in which the detectable is fired and containing the variable contexts
public VMBeliefCtx matchesBelief(VMActiveInstanceCtx agent, VMFrameCtx frame)
agent
- the agent for whom the detectable is checked and whom's
belief set is to be checked against detectable conditionframe
- the frame in which the detectable is fired and containing the variable contexts
public boolean matchesBelief(VMBeliefCtx belief, VMActiveInstanceCtx agent, VMFrameCtx frame)
belief
- the belief to be testedagent
- the agent for whom the detectable is checkedframe
- the frame in which the detectable is fired and containing the variable contexts
public IDetectableCtx createContext()
Note: This method always returns a new instance and does not verify whether one is already created.
createContext
in class Detectable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |