gov.nasa.arc.brahms.vm.api.common
Class BeliefFactory

java.lang.Object
  extended by gov.nasa.arc.brahms.vm.api.common.BeliefFactory

public class BeliefFactory
extends java.lang.Object

The BeliefFactory provides methods to create new beliefs.


Constructor Summary
BeliefFactory()
           
 
Method Summary
static IBelief createBelief(IConcept concept, IAttribute attribute, int relop, boolean value)
          Creates a new IBelief of the form concept.attribute relop value where relop is one of EQUALS or NOT_EQUALS and the value is a boolean.
static IBelief createBelief(IConcept concept, IAttribute attribute, int relop, double value)
          Creates a new IBelief of the form concept.attribute relop value where relop is one of EQUALS or NOT_EQUALS and the value is a double.
static IBelief createBelief(IConcept concept, IAttribute attribute, int relop, IConcept value)
          Creates a new IBelief of the form concept.attribute relop value where relop is one of EQUALS or NOT_EQUALS and the value is an IConcept.
static IBelief createBelief(IConcept concept, IAttribute attribute, int relop, int value)
          Creates a new IBelief of the form concept.attribute relop value where relop is one of EQUALS or NOT_EQUALS and the value is an integer.
static IBelief createBelief(IConcept concept, IAttribute attribute, int relop, IUnknown value)
          Creates a new IBelief of the form concept.attribute relop value where relop is one of EQUALS or NOT_EQUALS and the value is the value 'unknown'.
static IBelief createBelief(IConcept concept, IAttribute attribute, int relop, java.lang.String value, boolean symbol)
          Creates a new IBelief of the form concept.attribute relop value where relop is one of EQUALS or NOT_EQUALS and the value is a String.
static IBelief createBelief(IConcept lhsConcept, IRelation relation, IConcept rhsConcept)
          Creates a new IBelief of the form concept relation concept.
static IBelief createBelief(IConcept lhsConcept, IRelation relation, IConcept rhsConcept, int truthValue)
          Creates a new IBelief of the form concept relation concept.
static IBelief createBelief(IConcept lhsConcept, IRelation relation, IUnknown rhsConcept)
          Creates a new IBelief of the form concept relation concept.
static IBelief createBelief(IConcept lhsConcept, IRelation relation, IUnknown rhsConcept, int truthValue)
          Creates a new IBelief of the form concept relation concept.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeliefFactory

public BeliefFactory()
Method Detail

createBelief

public static IBelief createBelief(IConcept concept,
                                   IAttribute attribute,
                                   int relop,
                                   IUnknown value)
                            throws ExternalException
Creates a new IBelief of the form concept.attribute relop value where relop is one of EQUALS or NOT_EQUALS and the value is the value 'unknown'.

Parameters:
concept - the IConcept for which an attribute value is specified
attribute - the IAttribute defined for the concept to which to assign a value
relop - the relational operator, one of IRelationalOperator.EQUALS or IRelationalOperator.NOT_EQUALS.
value - the value 'unknown' to be assigned to the attribute
Returns:
IBelief a wrapper for the created belief that can be asserted to or retracted from an agent's beliefset.
Throws:
ExternalException - if the value does not match with the attribute's type, the attribute is not specified for the given concept, or if an invalid relational operator is specified.
See Also:
IRelationalOperator.EQUALS, IRelationalOperator.NOT_EQUALS, IUnknown.UNKNOWN

createBelief

public static IBelief createBelief(IConcept concept,
                                   IAttribute attribute,
                                   int relop,
                                   int value)
                            throws ExternalException
Creates a new IBelief of the form concept.attribute relop value where relop is one of EQUALS or NOT_EQUALS and the value is an integer. The attribute's type must be int or double.

Parameters:
concept - the IConcept for which an attribute value is specified
attribute - the IAttribute defined for the concept to which to assign a value
relop - the relational operator, one of IRelationalOperator.EQUALS or IRelationalOperator.NOT_EQUALS.
value - the integer value to be assigned to the attribute
Returns:
IBelief a wrapper for the created belief that can be asserted to or retracted from an agent's beliefset.
Throws:
ExternalException - if the value does not match with the attribute's type, the attribute is not specified for the given concept, or if an invalid relational operator is specified.
See Also:
IRelationalOperator.EQUALS, IRelationalOperator.NOT_EQUALS

createBelief

public static IBelief createBelief(IConcept concept,
                                   IAttribute attribute,
                                   int relop,
                                   double value)
                            throws ExternalException
Creates a new IBelief of the form concept.attribute relop value where relop is one of EQUALS or NOT_EQUALS and the value is a double. The attribute's type must be double.

Parameters:
concept - the IConcept for which an attribute value is specified
attribute - the IAttribute defined for the concept to which to assign a value
relop - the relational operator, one of IRelationalOperator.EQUALS or IRelationalOperator.NOT_EQUALS.
value - the double value to be assigned to the attribute
Returns:
IBelief a wrapper for the created belief that can be asserted to or retracted from an agent's beliefset.
Throws:
ExternalException - if the value does not match with the attribute's type, or if an invalid relational operator is specified.
See Also:
IRelationalOperator.EQUALS, IRelationalOperator.NOT_EQUALS

createBelief

public static IBelief createBelief(IConcept concept,
                                   IAttribute attribute,
                                   int relop,
                                   boolean value)
                            throws ExternalException
Creates a new IBelief of the form concept.attribute relop value where relop is one of EQUALS or NOT_EQUALS and the value is a boolean. The attribute's type must be boolean.

Parameters:
concept - the IConcept for which an attribute value is specified
attribute - the IAttribute defined for the concept to which to assign a value
relop - the relational operator, one of IRelationalOperator.EQUALS or IRelationalOperator.NOT_EQUALS.
value - the boolean value to be assigned to the attribute
Returns:
IBelief a wrapper for the created belief that can be asserted to or retracted from an agent's beliefset.
Throws:
ExternalException - if the value does not match with the attribute's type, the attribute is not specified for the given concept or if an invalid relational operator is specified.
See Also:
IRelationalOperator.EQUALS, IRelationalOperator.NOT_EQUALS

createBelief

public static IBelief createBelief(IConcept concept,
                                   IAttribute attribute,
                                   int relop,
                                   java.lang.String value,
                                   boolean symbol)
                            throws ExternalException
Creates a new IBelief of the form concept.attribute relop value where relop is one of EQUALS or NOT_EQUALS and the value is a String. The attribute's type must be symbol or string.

Parameters:
concept - the IConcept for which an attribute value is specified
attribute - the IAttribute defined for the concept to which to assign a value
relop - the relational operator, one of IRelationalOperator.EQUALS or IRelationalOperator.NOT_EQUALS.
value - the String value to be assigned to the attribute
symbol - indicates if the value is a symbol or string
Returns:
IBelief a wrapper for the created belief that can be asserted to or retracted from an agent's beliefset.
Throws:
ExternalException - if the value does not match with the attribute's type, the attribute is not specified for the given concept, or if an invalid relational operator is specified.
See Also:
IRelationalOperator.EQUALS, IRelationalOperator.NOT_EQUALS

createBelief

public static IBelief createBelief(IConcept concept,
                                   IAttribute attribute,
                                   int relop,
                                   IConcept value)
                            throws ExternalException
Creates a new IBelief of the form concept.attribute relop value where relop is one of EQUALS or NOT_EQUALS and the value is an IConcept. The attribute's type must be an IMetaType or IConcept. The attribute name must not be 'location'. The 'location' attribute's value is managed by the virtual machine.

Parameters:
concept - the IConcept for which an attribute value is specified
attribute - the IAttribute defined for the concept to which to assign a value
relop - the relational operator, one of IRelationalOperator.EQUALS or IRelationalOperator.NOT_EQUALS.
value - the IConcept value to be assigned to the attribute
Returns:
IBelief a wrapper for the created belief that can be asserted to or retracted from an agent's beliefset.
Throws:
ExternalException - if the value does not match with the attribute's type, the attribute is not specified for the given concept, the attribute is the location attribute or if an invalid relational operator is specified.
See Also:
IRelationalOperator.EQUALS, IRelationalOperator.NOT_EQUALS

createBelief

public static IBelief createBelief(IConcept lhsConcept,
                                   IRelation relation,
                                   IUnknown rhsConcept)
                            throws ExternalException
Creates a new IBelief of the form concept relation concept. The truth-value is set to true.

Parameters:
lhsConcept - the IConcept for which the relation is specified
relation - the IRelation defined for the concept
rhsConcept - the IUnknown value to be related to the lhsConcept
Returns:
IBelief a wrapper for the created belief that can be asserted to or retracted from an agent's beliefset.
Throws:
ExternalException - if the rhsConcept does not match with the relation's type or the relation is not specified for the given lhsConcept.
See Also:
IUnknown.UNKNOWN

createBelief

public static IBelief createBelief(IConcept lhsConcept,
                                   IRelation relation,
                                   IConcept rhsConcept)
                            throws ExternalException
Creates a new IBelief of the form concept relation concept. The truth-value is set to true.

Parameters:
lhsConcept - the IConcept for which the relation is specified
relation - the IRelation defined for the concept
rhsConcept - the IConcept to be related to the lhsConcept
Returns:
IBelief a wrapper for the created belief that can be asserted to or retracted from an agent's beliefset.
Throws:
ExternalException - if the rhsConcept does not match with the relation's type or the relation is not specified for the given lhsConcept.

createBelief

public static IBelief createBelief(IConcept lhsConcept,
                                   IRelation relation,
                                   IUnknown rhsConcept,
                                   int truthValue)
                            throws ExternalException
Creates a new IBelief of the form concept relation concept.

Parameters:
lhsConcept - the IConcept for which the relation is specified
relation - the IRelation defined for the concept
rhsConcept - the IUnknown value to be related to the lhsConcept
truthValue - the truth value of the relationship (TRUE, FALSE, UNKNOWN)
Returns:
IBelief a wrapper for the created belief that can be asserted to or retracted from an agent's beliefset.
Throws:
ExternalException - if the rhsConcept does not match with the relation's type or the relation is not specified for the given lhsConcept.
See Also:
IUnknown.UNKNOWN, ITruthValue.TRUE, ITruthValue.FALSE, ITruthValue.UNKNOWN

createBelief

public static IBelief createBelief(IConcept lhsConcept,
                                   IRelation relation,
                                   IConcept rhsConcept,
                                   int truthValue)
                            throws ExternalException
Creates a new IBelief of the form concept relation concept.

Parameters:
lhsConcept - the IConcept for which the relation is specified
relation - the IRelation defined for the concept
rhsConcept - the IConcept to be related to the lhsConcept
truthValue - the truth value of the relationship (TRUE, FALSE, UNKNOWN)
Returns:
IBelief a wrapper for the created belief that can be asserted to or retracted from an agent's beliefset.
Throws:
ExternalException - if the rhsConcept does not match with the relation's type or the relation is not specified for the given lhsConcept.
See Also:
ITruthValue.TRUE, ITruthValue.FALSE, ITruthValue.UNKNOWN