gov.nasa.arc.brahms.common.data
Class Consequence

java.lang.Object
  extended by gov.nasa.arc.brahms.common.data.BrahmsObject
      extended by gov.nasa.arc.brahms.common.data.ModelElement
          extended by gov.nasa.arc.brahms.common.data.Condition
              extended by gov.nasa.arc.brahms.common.data.Consequence
All Implemented Interfaces:
gov.nasa.arc.brahms.common.IConstants, java.io.Serializable
Direct Known Subclasses:
VMConsequence

public class Consequence
extends Condition

A consequences is a logical statement for concluding/asserting new beliefs for an agent or object and/or facts in the world.

Version:
$Revision: 1.2 $ $Date: 2009/11/23 19:08:56 $ $Author: rnado $
Author:
Ron van Hoof
See Also:
Serialized Form

Field Summary
static java.lang.String BELIEF_CERTAINTY_PROPERTY
          Configuration property name for belief certainty
static java.lang.String BELIEF_CHANGE_SUPPORT_PROPERTY
          Configuration property name for belief change support
static java.lang.String CHANGE_SUPPORT_PROPERTY
          Configuration property name for change support
static java.lang.String FACT_CERTAINTY_PROPERTY
          Configuration property name for fact certainty
static java.lang.String FACT_CHANGE_SUPPORT_PROPERTY
          Configuration property name for fact change support
 
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
Consequence()
          Constructor, creates a new Consequence.
Consequence(Comparison c)
          Constructor, creates a new Consequence with the specified Comparison specifying the conditional expression with a truth value of TRUE and a belief and fact certainty of 100.
Consequence(Comparison c, int truth)
          Constructor, creates a new Consequence with the specified Comparison specifying the conditional expression with the specified truth value and a belief and fact certainty of 100.
Consequence(Comparison c, int bc, int fc)
          Constructor, creates a new Consequence with the specified Comparison specifying the conditional expression with a truth value of TRUE and with the specified belief and fact certainties.
Consequence(Comparison c, int truth, int bc, int fc)
          Constructor, creates a new Consequence with the specified Comparison specifying the conditional expression and with the specified truth value, belief and fact certainty.
Consequence(java.util.List<Comparison> comparisons, int truth, int bc, int fc)
          Constructor, creates a new Consequence with the specified Comparisons specifying the conditional expression and with the specified truth value, belief and fact certainty.
 
Method Summary
 IConsequenceCtx createContext()
          Creates a new context for this consequence.
 int getBeliefCertainty()
          Returns the certainty with which the consequence asserts a belief (0-100).
 java.util.List<Comparison> getComparisons()
          Returns the comparisons defining the expression for concluding new state.
 int getFactCertainty()
          Returns the certainty with which the consequence asserts a fact (0-100).
 boolean isBeliefChangeSupportEnabled()
          Indicates whether to register property change support to automatically assert beliefs for property value changes for Java properties if the lhs object in a comparison is of a java type and that objects implements a property change support interface.
 boolean isExpanded()
           
 boolean isFactChangeSupportEnabled()
          Indicates whether to register property change support to automatically assert facts for property value changes for Java properties if the lhs object in a comparison is of a java type and that objects implements a property change support interface.
 void setBeliefCertainty(int bc)
          Sets the certainty with which the consequence asserts a belief (0-100).
 void setBeliefChangeSupportEnabled(boolean enabled)
          Sets whether to register property change support to automatically assert beliefs for property value changes for Java properties if the lhs object in a comparison is of a java type and that objects implements a property change support interface.
 void setComparisons(java.util.List<Comparison> comparisons)
          Sets the comparisons defining the expression for concluding new state.
 void setExpanded(boolean expanded)
           
 void setFactCertainty(int fc)
          Sets the certainty with which the consequence asserts a fact (0-100).
 void setFactChangeSupportEnabled(boolean enabled)
          Sets whether to register property change support to automatically assert facts for property value changes for Java properties if the lhs object in a comparison is of a java type and that objects implements a property change support interface.
protected  void setID()
          Sets the unique identifier.
 java.lang.String toSource()
          Returns a source code representation for the consequence.
 java.lang.String toString()
          Returns a String representation of the Consequence.
 
Methods inherited from class gov.nasa.arc.brahms.common.data.Condition
getComparison, getOwner, getParameters, getTruthValue, getTruthValueAsString, getVariables, setComparison, setOwner, setOwner, setOwner, setTruthValue
 
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
 

Field Detail

FACT_CERTAINTY_PROPERTY

public static final java.lang.String FACT_CERTAINTY_PROPERTY
Configuration property name for fact certainty

See Also:
Constant Field Values

BELIEF_CERTAINTY_PROPERTY

public static final java.lang.String BELIEF_CERTAINTY_PROPERTY
Configuration property name for belief certainty

See Also:
Constant Field Values

BELIEF_CHANGE_SUPPORT_PROPERTY

public static final java.lang.String BELIEF_CHANGE_SUPPORT_PROPERTY
Configuration property name for belief change support

See Also:
Constant Field Values

FACT_CHANGE_SUPPORT_PROPERTY

public static final java.lang.String FACT_CHANGE_SUPPORT_PROPERTY
Configuration property name for fact change support

See Also:
Constant Field Values

CHANGE_SUPPORT_PROPERTY

public static final java.lang.String CHANGE_SUPPORT_PROPERTY
Configuration property name for change support

See Also:
Constant Field Values
Constructor Detail

Consequence

public Consequence()
Constructor, creates a new Consequence.


Consequence

public Consequence(Comparison c)
Constructor, creates a new Consequence with the specified Comparison specifying the conditional expression with a truth value of TRUE and a belief and fact certainty of 100.

Parameters:
c - the Comparison

Consequence

public Consequence(Comparison c,
                   int truth)
Constructor, creates a new Consequence with the specified Comparison specifying the conditional expression with the specified truth value and a belief and fact certainty of 100.

Parameters:
c - the Comparison
truth - the truth value for the resulting belief/fact
See Also:
IConstants.TRUE, IConstants.FALSE, IConstants.UNKNOWN

Consequence

public Consequence(Comparison c,
                   int bc,
                   int fc)
Constructor, creates a new Consequence with the specified Comparison specifying the conditional expression with a truth value of TRUE and with the specified belief and fact certainties.

Parameters:
c - the Comparison
bc - the belief certainty percentage (0-100)
fc - the fact certainty percentage (0-100)

Consequence

public Consequence(Comparison c,
                   int truth,
                   int bc,
                   int fc)
Constructor, creates a new Consequence with the specified Comparison specifying the conditional expression and with the specified truth value, belief and fact certainty.

Parameters:
c - the Comparison
truth - the truth value for the resulting belief/fact
bc - the belief certainty percentage (0-100)
fc - the fact certainty percentage (0-100)
See Also:
IConstants.TRUE, IConstants.FALSE, IConstants.UNKNOWN

Consequence

public Consequence(java.util.List<Comparison> comparisons,
                   int truth,
                   int bc,
                   int fc)
Constructor, creates a new Consequence with the specified Comparisons specifying the conditional expression and with the specified truth value, belief and fact certainty.

Parameters:
comparisons - the List
truth - the truth value for the resulting belief/fact
bc - the belief certainty percentage (0-100)
fc - the fact certainty percentage (0-100)
See Also:
IConstants.TRUE, IConstants.FALSE, IConstants.UNKNOWN
Method Detail

setID

protected void setID()
Sets the unique identifier.

Overrides:
setID in class BrahmsObject

setComparisons

public void setComparisons(java.util.List<Comparison> comparisons)
Sets the comparisons defining the expression for concluding new state.

Parameters:
comparisons - the list of comparisons
See Also:
Comparison, ValueComparison, ObjectComparison

getComparisons

public java.util.List<Comparison> getComparisons()
Returns the comparisons defining the expression for concluding new state.

Returns:
List the list of comparisons
See Also:
Comparison, ValueComparison, ObjectComparison

setBeliefCertainty

public void setBeliefCertainty(int bc)
Sets the certainty with which the consequence asserts a belief (0-100).

Parameters:
bc - the belief certainty percentage

getBeliefCertainty

public int getBeliefCertainty()
Returns the certainty with which the consequence asserts a belief (0-100).

Returns:
int the belief certainty percentage

setFactCertainty

public void setFactCertainty(int fc)
Sets the certainty with which the consequence asserts a fact (0-100).

Parameters:
fc - the fact certainty percentage

getFactCertainty

public int getFactCertainty()
Returns the certainty with which the consequence asserts a fact (0-100).

Returns:
int the fact certainty percentage

setBeliefChangeSupportEnabled

public void setBeliefChangeSupportEnabled(boolean enabled)
Sets whether to register property change support to automatically assert beliefs for property value changes for Java properties if the lhs object in a comparison is of a java type and that objects implements a property change support interface.

Parameters:
enabled - true to enable belief change support, false to disable it

isBeliefChangeSupportEnabled

public boolean isBeliefChangeSupportEnabled()
Indicates whether to register property change support to automatically assert beliefs for property value changes for Java properties if the lhs object in a comparison is of a java type and that objects implements a property change support interface.

Returns:
boolean true indicating belief change support is enabled, false if is disabled

setFactChangeSupportEnabled

public void setFactChangeSupportEnabled(boolean enabled)
Sets whether to register property change support to automatically assert facts for property value changes for Java properties if the lhs object in a comparison is of a java type and that objects implements a property change support interface.

Parameters:
enabled - true to enable fact change support, false to disable it

isFactChangeSupportEnabled

public boolean isFactChangeSupportEnabled()
Indicates whether to register property change support to automatically assert facts for property value changes for Java properties if the lhs object in a comparison is of a java type and that objects implements a property change support interface.

Returns:
boolean true indicating fact change support is enabled, false if is disabled

setExpanded

public void setExpanded(boolean expanded)

isExpanded

public boolean isExpanded()

createContext

public IConsequenceCtx createContext()
Creates a new context for this consequence.

Note: This method always returns a new instance and does not verify whether one is already created.

Returns:
IConsequenceCtx a context for the consequence

toSource

public java.lang.String toSource()
Returns a source code representation for the consequence.

Overrides:
toSource in class Condition
Returns:
String the source code representation

toString

public java.lang.String toString()
Returns a String representation of the Consequence.

Overrides:
toString in class Condition
Returns:
String the stringified Consequence


Copyright © 1997-2012 All Rights Reserved.