gov.nasa.arc.brahms.vm.api.common
Interface IActiveInstance

All Superinterfaces:
IActiveConcept, IConcept, IType, IUserDefinedType
All Known Subinterfaces:
IAgent, IObject

public interface IActiveInstance
extends IActiveConcept

An ActiveInstance is a generic concept that indicates that the instance can have behavior. It is a concept that can reason with beliefs or facts and can perform activities.


Field Summary
 
Fields inherited from interface gov.nasa.arc.brahms.vm.api.common.IUserDefinedType
UDT
 
Method Summary
 void assertBelief(IBelief belief, IContext ctx)
          Schedules the assertion of the specified belief to the active instance's belief set.
 void assertBeliefs(IBelief[] beliefs, IContext ctx)
          Schedules the assertion of the specified beliefs to the active instance's belief set.
 IBelief getBelief(IConcept lhsConcept, IAttribute lhsAttribute, int relop, boolean value, IContext ctx)
          Find the belief using the specified parameters and return the belief if found, null if the belief was not found.
 IBelief getBelief(IConcept lhsConcept, IAttribute lhsAttribute, int relop, double value, IContext ctx)
          Find the belief using the specified parameters and return the belief if found, null if the belief was not found.
 IBelief getBelief(IConcept lhsConcept, IAttribute lhsAttribute, int relop, IConcept value, IContext ctx)
          Find the belief using the specified parameters and return the belief if found, null if the belief was not found.
 IBelief getBelief(IConcept lhsConcept, IAttribute lhsAttribute, int relop, int value, IContext ctx)
          Find the belief using the specified parameters and return the belief if found, null if the belief was not found.
 IBelief getBelief(IConcept lhsConcept, IAttribute lhsAttribute, int relop, IUnknown value, IContext ctx)
          Find the belief using the specified parameters and return the belief if found, null if the belief was not found.
 IBelief getBelief(IConcept lhsConcept, IAttribute lhsAttribute, int relop, java.lang.String value, IContext ctx)
          Find the belief using the specified parameters and return the belief if found, null if the belief was not found.
 IBelief getBelief(IConcept lhsConcept, IRelation relation, IConcept rhsConcept, int truthValue, IContext ctx)
          Find the belief using the specified parameters and return the belief if found, null if the belief was not found.
 IBelief getBelief(IConcept lhsConcept, IRelation relation, IUnknown rhsConcept, int truthValue, IContext ctx)
          Find the belief using the specified parameters and return the belief if found, null if the belief was not found.
 java.util.Enumeration getBeliefs(IAttribute lhsAttribute, IContext ctx)
          Returns a list of all the beliefs that have the specified attribute on their left hand side regardless of their lhs concept, relational operator or value.
 java.util.Enumeration getBeliefs(IConcept lhsConcept, IAttribute lhsAttribute, IContext ctx)
          Returns a list of all the beliefs that have the specified concept and attribute on their left hand side regardless of their relational operator or value.
 java.util.Enumeration getBeliefs(IConcept lhsConcept, IAttribute lhsAttribute, int relop, IContext ctx)
          Returns a list of all the beliefs that have the specified concept and attribute on their left hand side and that use the specified relational operator.
 java.util.Enumeration getBeliefs(IConcept lhsConcept, IRelation relation, IContext ctx)
          Returns a list of all the beliefs that have the specified left hand side concept and relation regardless of their right hand side concept.
 java.util.Enumeration getBeliefs(IConcept lhsConcept, IRelation relation, int truthvalue, IContext ctx)
          Returns a list of all the beliefs that have the specified left hand side concept, relation and truth value regardless of their right hand side concept.
 java.util.Enumeration getBeliefs(IContext ctx)
          Returns the active instance's belief set.
 java.util.Enumeration getBeliefs(IRelation relation, IConcept rhsConcept, int truthvalue, IContext ctx)
          Returns a list of all the beliefs that have the specified relation and right hand side concept, and truth value regardless of their left hand side concept.
 java.util.Enumeration getBeliefs(IRelation relation, IContext ctx)
          Returns a list of all the beliefs that have the specified relation regardless of their left and right hand side concept.
 java.util.Enumeration getBeliefs(IRelation relation, IUnknown rhsConcept, int truthvalue, IContext ctx)
          Returns a list of all the beliefs that have the specified relation, as right hand side 'unknown', and the specified truth value regardless of their left hand side concept.
 void retractBelief(IBelief belief, IContext ctx)
          Schedules the retraction of the specified belief from the active instance's belief set.
 
Methods inherited from interface gov.nasa.arc.brahms.vm.api.common.IActiveConcept
hasThoughtframes, hasWorkframes
 
Methods inherited from interface gov.nasa.arc.brahms.vm.api.common.IConcept
getAttribute, getName, getRelation, isLocal
 
Methods inherited from interface gov.nasa.arc.brahms.vm.api.common.IType
getType
 

Method Detail

assertBelief

void assertBelief(IBelief belief,
                  IContext ctx)
                  throws ExternalException
Schedules the assertion of the specified belief to the active instance's belief set. The assertion of the belief is scheduled on the active instance's discrete event queue for processing by the active instance. The belief will not immediately be asserted in the belief set.

Note: If multiple beliefs are to be asserted to a remote agent use the assert method to which multiple beliefs can be passed to reduce communication overhead. The beliefs will be bundled in one communication package in that case, while with this method for each belief a separate communication package is created.

Parameters:
belief - the IBelief to be asserted
ctx - the IContext for the action
Throws:
ExternalException - if an internal error occurs, in case of a communication failure the linked exception will be one of NotLocatableException, TransportFailure, or MessageNotRepliedToException
See Also:
javax.agent.service.transport.NotLocatableException, javax.agent.service.transport.TransportFailure, MessageNotRepliedToException

assertBeliefs

void assertBeliefs(IBelief[] beliefs,
                   IContext ctx)
                   throws ExternalException
Schedules the assertion of the specified beliefs to the active instance's belief set. The assertion of the beliefs is scheduled on the active instance's discrete event queue for processing by the active instance. The belief will not immediately be asserted in the belief set.

Note: If multiple beliefs are to be transmitted to a remote agent this method should be used to reduce communication overhead. The beliefs will be bundled in one communication package.

Parameters:
beliefs - the set of IBelief to be asserted
ctx - the IContext for the action
Throws:
ExternalException - if an internal error occurs, in case of a communication failure the linked exception will be one of NotLocatableException, TransportFailure, or MessageNotRepliedToException
See Also:
javax.agent.service.transport.NotLocatableException, javax.agent.service.transport.TransportFailure, MessageNotRepliedToException

retractBelief

void retractBelief(IBelief belief,
                   IContext ctx)
                   throws ExternalException
Schedules the retraction of the specified belief from the active instance's belief set. The retraction of the belief is scheduled on the active instance's discrete event queue for processing by the active instance. The belief will not immediately be retracted from the belief set.

Parameters:
belief - the IBelief to be asserted
ctx - the IContext for the action
Throws:
ExternalException - if an internal error occurs

getBelief

IBelief getBelief(IConcept lhsConcept,
                  IAttribute lhsAttribute,
                  int relop,
                  int value,
                  IContext ctx)
                  throws ExternalException
Find the belief using the specified parameters and return the belief if found, null if the belief was not found.

Parameters:
lhsConcept - the left hand side IConcept in the requested belief
lhsAttribute - the left hand side IAttribute in the requested belief
relop - the relational operator in the requested belief
value - the right hand side integer value in the requested belief
ctx - the IContext for the action
Returns:
IBelief if the matching belief is found, null otherwise
Throws:
ExternalException - if an internal error occurs, in case of a communication failure the linked exception will be one of NotLocatableException, TransportFailure, or MessageNotRepliedToException
See Also:
javax.agent.service.transport.NotLocatableException, javax.agent.service.transport.TransportFailure, MessageNotRepliedToException, IRelationalOperator.EQUALS, IRelationalOperator.NOT_EQUALS

getBelief

IBelief getBelief(IConcept lhsConcept,
                  IAttribute lhsAttribute,
                  int relop,
                  double value,
                  IContext ctx)
                  throws ExternalException
Find the belief using the specified parameters and return the belief if found, null if the belief was not found.

Parameters:
lhsConcept - the left hand side IConcept in the requested belief
lhsAttribute - the left hand side IAttribute in the requested belief
relop - the relational operator in the requested belief
value - the right hand side double value in the requested belief
ctx - the IContext for the action
Returns:
IBelief if the matching belief is found, null otherwise
Throws:
ExternalException - if an internal error occurs, in case of a communication failure the linked exception will be one of NotLocatableException, TransportFailure, or MessageNotRepliedToException
See Also:
javax.agent.service.transport.NotLocatableException, javax.agent.service.transport.TransportFailure, MessageNotRepliedToException, IRelationalOperator.EQUALS, IRelationalOperator.NOT_EQUALS

getBelief

IBelief getBelief(IConcept lhsConcept,
                  IAttribute lhsAttribute,
                  int relop,
                  boolean value,
                  IContext ctx)
                  throws ExternalException
Find the belief using the specified parameters and return the belief if found, null if the belief was not found.

Parameters:
lhsConcept - the left hand side IConcept in the requested belief
lhsAttribute - the left hand side IAttribute in the requested belief
relop - the relational operator in the requested belief
value - the right hand side boolean value in the requested belief
ctx - the IContext for the action
Returns:
IBelief if the matching belief is found, null otherwise
Throws:
ExternalException - if an internal error occurs, in case of a communication failure the linked exception will be one of NotLocatableException, TransportFailure, or MessageNotRepliedToException
See Also:
javax.agent.service.transport.NotLocatableException, javax.agent.service.transport.TransportFailure, MessageNotRepliedToException, IRelationalOperator.EQUALS, IRelationalOperator.NOT_EQUALS

getBelief

IBelief getBelief(IConcept lhsConcept,
                  IAttribute lhsAttribute,
                  int relop,
                  java.lang.String value,
                  IContext ctx)
                  throws ExternalException
Find the belief using the specified parameters and return the belief if found, null if the belief was not found.

Parameters:
lhsConcept - the left hand side IConcept in the requested belief
lhsAttribute - the left hand side IAttribute in the requested belief
relop - the relational operator in the requested belief
value - the right hand side string or symbol value in the requested belief
ctx - the IContext for the action
Returns:
IBelief if the matching belief is found, null otherwise
Throws:
ExternalException - if an internal error occurs, in case of a communication failure the linked exception will be one of NotLocatableException, TransportFailure, or MessageNotRepliedToException
See Also:
javax.agent.service.transport.NotLocatableException, javax.agent.service.transport.TransportFailure, MessageNotRepliedToException, IRelationalOperator.EQUALS, IRelationalOperator.NOT_EQUALS

getBelief

IBelief getBelief(IConcept lhsConcept,
                  IAttribute lhsAttribute,
                  int relop,
                  IConcept value,
                  IContext ctx)
                  throws ExternalException
Find the belief using the specified parameters and return the belief if found, null if the belief was not found.

Parameters:
lhsConcept - the left hand side IConcept in the requested belief
lhsAttribute - the left hand side IAttribute in the requested belief
relop - the relational operator in the requested belief
value - the right hand side IConcept value in the requested belief
ctx - the IContext for the action
Returns:
IBelief if the matching belief is found, null otherwise
Throws:
ExternalException - if an internal error occurs, in case of a communication failure the linked exception will be one of NotLocatableException, TransportFailure, or MessageNotRepliedToException
See Also:
javax.agent.service.transport.NotLocatableException, javax.agent.service.transport.TransportFailure, MessageNotRepliedToException, IRelationalOperator.EQUALS, IRelationalOperator.NOT_EQUALS

getBelief

IBelief getBelief(IConcept lhsConcept,
                  IAttribute lhsAttribute,
                  int relop,
                  IUnknown value,
                  IContext ctx)
                  throws ExternalException
Find the belief using the specified parameters and return the belief if found, null if the belief was not found.

Parameters:
lhsConcept - the left hand side IConcept in the requested belief
lhsAttribute - the left hand side IAttribute in the requested belief
relop - the relational operator in the requested belief
value - the right hand side 'unknown' value in the requested fact
ctx - the IContext for the action
Returns:
IBelief if the matching belief is found, null otherwise
Throws:
ExternalException - if an internal error occurs, in case of a communication failure the linked exception will be one of NotLocatableException, TransportFailure, or MessageNotRepliedToException
See Also:
javax.agent.service.transport.NotLocatableException, javax.agent.service.transport.TransportFailure, MessageNotRepliedToException, IRelationalOperator.EQUALS, IRelationalOperator.NOT_EQUALS, IUnknown.UNKNOWN

getBelief

IBelief getBelief(IConcept lhsConcept,
                  IRelation relation,
                  IConcept rhsConcept,
                  int truthValue,
                  IContext ctx)
                  throws ExternalException
Find the belief using the specified parameters and return the belief if found, null if the belief was not found.

Parameters:
lhsConcept - the left hand side IConcept in the requested belief
relation - the IRelation in the requested belief
rhsConcept - the right hand side IConcept in the requested belief
truthvalue - the truth value in the requested belief (TRUE, FALSE, UNKNOWN)
ctx - the IContext for the action
Returns:
IBelief if the matching belief is found, null otherwise
Throws:
ExternalException - if an internal error occurs, in case of a communication failure the linked exception will be one of NotLocatableException, TransportFailure, or MessageNotRepliedToException
See Also:
javax.agent.service.transport.NotLocatableException, javax.agent.service.transport.TransportFailure, MessageNotRepliedToException, ITruthValue.TRUE, ITruthValue.FALSE, ITruthValue.UNKNOWN

getBelief

IBelief getBelief(IConcept lhsConcept,
                  IRelation relation,
                  IUnknown rhsConcept,
                  int truthValue,
                  IContext ctx)
                  throws ExternalException
Find the belief using the specified parameters and return the belief if found, null if the belief was not found.

Parameters:
lhsConcept - the left hand side IConcept in the requested belief
relation - the IRelation in the requested belief
rhsConcept - the right hand side 'unknown' value in the requested fact
truthvalue - the truth value in the requested belief (TRUE, FALSE, UNKNOWN)
ctx - the IContext for the action
Returns:
IBelief if the matching belief is found, null otherwise
Throws:
ExternalException - if an internal error occurs, in case of a communication failure the linked exception will be one of NotLocatableException, TransportFailure, or MessageNotRepliedToException
See Also:
javax.agent.service.transport.NotLocatableException, javax.agent.service.transport.TransportFailure, MessageNotRepliedToException, ITruthValue.TRUE, ITruthValue.FALSE, ITruthValue.UNKNOWN, ITruthValue.UNKNOWN

getBeliefs

java.util.Enumeration getBeliefs(IContext ctx)
                                 throws ExternalException
Returns the active instance's belief set.

Parameters:
ctx - the IContext for the action
Returns:
Enumeration an enumeration of IBelief's
Throws:
ExternalException - if an internal error occurs, in case of a communication failure the linked exception will be one of NotLocatableException, TransportFailure, or MessageNotRepliedToException
See Also:
javax.agent.service.transport.NotLocatableException, javax.agent.service.transport.TransportFailure, MessageNotRepliedToException

getBeliefs

java.util.Enumeration getBeliefs(IAttribute lhsAttribute,
                                 IContext ctx)
                                 throws ExternalException
Returns a list of all the beliefs that have the specified attribute on their left hand side regardless of their lhs concept, relational operator or value.

Parameters:
lhsAttribute - the left hand side IAttribute in the requested belief(s)
ctx - the IContext for the action
Returns:
Enumeration an enumeration of IBelief's
Throws:
ExternalException - if an internal error occurs, in case of a communication failure the linked exception will be one of NotLocatableException, TransportFailure, or MessageNotRepliedToException
See Also:
javax.agent.service.transport.NotLocatableException, javax.agent.service.transport.TransportFailure, MessageNotRepliedToException

getBeliefs

java.util.Enumeration getBeliefs(IConcept lhsConcept,
                                 IAttribute lhsAttribute,
                                 IContext ctx)
                                 throws ExternalException
Returns a list of all the beliefs that have the specified concept and attribute on their left hand side regardless of their relational operator or value.

Parameters:
lhsConcept - the left hand side IConcept in the requested belief(s)
lhsAttribute - the left hand side IAttribute in the requested belief(s)
ctx - the IContext for the action
Returns:
Enumeration a list of IBelief's
Throws:
ExternalException - if an internal error occurs, in case of a communication failure the linked exception will be one of NotLocatableException, TransportFailure, or MessageNotRepliedToException
See Also:
javax.agent.service.transport.NotLocatableException, javax.agent.service.transport.TransportFailure, MessageNotRepliedToException

getBeliefs

java.util.Enumeration getBeliefs(IConcept lhsConcept,
                                 IAttribute lhsAttribute,
                                 int relop,
                                 IContext ctx)
                                 throws ExternalException
Returns a list of all the beliefs that have the specified concept and attribute on their left hand side and that use the specified relational operator.

Parameters:
lhsConcept - the left hand side IConcept in the requested belief(s)
lhsAttribute - the left hand side IAttribute in the requested belief(s)
relop - the relational operator in the requested belief(s)
ctx - the IContext for the action
Returns:
Enumeration a list of IBelief's
Throws:
ExternalException - if an internal error occurs, in case of a communication failure the linked exception will be one of NotLocatableException, TransportFailure, or MessageNotRepliedToException
See Also:
javax.agent.service.transport.NotLocatableException, javax.agent.service.transport.TransportFailure, MessageNotRepliedToException, IRelationalOperator.EQUALS, IRelationalOperator.NOT_EQUALS

getBeliefs

java.util.Enumeration getBeliefs(IRelation relation,
                                 IContext ctx)
                                 throws ExternalException
Returns a list of all the beliefs that have the specified relation regardless of their left and right hand side concept.

Parameters:
relation - the IRelation in the requested belief(s)
ctx - the IContext for the action
Returns:
Enumeration a list of IBelief's
Throws:
ExternalException - if an internal error occurs, in case of a communication failure the linked exception will be one of NotLocatableException, TransportFailure, or MessageNotRepliedToException
See Also:
javax.agent.service.transport.NotLocatableException, javax.agent.service.transport.TransportFailure, MessageNotRepliedToException

getBeliefs

java.util.Enumeration getBeliefs(IConcept lhsConcept,
                                 IRelation relation,
                                 IContext ctx)
                                 throws ExternalException
Returns a list of all the beliefs that have the specified left hand side concept and relation regardless of their right hand side concept.

Parameters:
lhsConcept - the left hand side IConcept in the requested belief(s)
relation - the IRelation in the requested belief(s)
ctx - the IContext for the action
Returns:
Enumeration a list of IBelief's
Throws:
ExternalException - if an internal error occurs, in case of a communication failure the linked exception will be one of NotLocatableException, TransportFailure, or MessageNotRepliedToException
See Also:
javax.agent.service.transport.NotLocatableException, javax.agent.service.transport.TransportFailure, MessageNotRepliedToException

getBeliefs

java.util.Enumeration getBeliefs(IConcept lhsConcept,
                                 IRelation relation,
                                 int truthvalue,
                                 IContext ctx)
                                 throws ExternalException
Returns a list of all the beliefs that have the specified left hand side concept, relation and truth value regardless of their right hand side concept.

Parameters:
lhsConcept - the left hand side IConcept in the requested belief(s)
relation - the IRelation in the requested belief(s)
truthvalue - the truth value in the requested belief(s) (TRUE, FALSE, UNKNOWN)
ctx - the IContext for the action
Returns:
Enumeration a list of IBelief's
Throws:
ExternalException - if an internal error occurs, in case of a communication failure the linked exception will be one of NotLocatableException, TransportFailure, or MessageNotRepliedToException
See Also:
javax.agent.service.transport.NotLocatableException, javax.agent.service.transport.TransportFailure, MessageNotRepliedToException, ITruthValue.TRUE, ITruthValue.FALSE, ITruthValue.UNKNOWN

getBeliefs

java.util.Enumeration getBeliefs(IRelation relation,
                                 IConcept rhsConcept,
                                 int truthvalue,
                                 IContext ctx)
                                 throws ExternalException
Returns a list of all the beliefs that have the specified relation and right hand side concept, and truth value regardless of their left hand side concept.

Parameters:
relation - the IRelation in the requested belief(s)
rhsConcept - the right hand side IConcept in the requested belief(s)
truthvalue - the truth value in the requested belief(s) (TRUE, FALSE, UNKNOWN)
ctx - the IContext for the action
Returns:
Enumeration a list of IBelief's
Throws:
ExternalException - if an internal error occurs, in case of a communication failure the linked exception will be one of NotLocatableException, TransportFailure, or MessageNotRepliedToException
See Also:
javax.agent.service.transport.NotLocatableException, javax.agent.service.transport.TransportFailure, MessageNotRepliedToException, ITruthValue.TRUE, ITruthValue.FALSE, ITruthValue.UNKNOWN

getBeliefs

java.util.Enumeration getBeliefs(IRelation relation,
                                 IUnknown rhsConcept,
                                 int truthvalue,
                                 IContext ctx)
                                 throws ExternalException
Returns a list of all the beliefs that have the specified relation, as right hand side 'unknown', and the specified truth value regardless of their left hand side concept.

Parameters:
relation - the IRelation in the requested belief(s)
rhsConcept - the right hand side 'unknown' value in the requested fact(s)
truthvalue - the truth value in the requested belief(s) (TRUE, FALSE, UNKNOWN)
ctx - the IContext for the action
Returns:
Enumeration a list of IBelief's
Throws:
ExternalException - if an internal error occurs, in case of a communication failure the linked exception will be one of NotLocatableException, TransportFailure, or MessageNotRepliedToException
See Also:
javax.agent.service.transport.NotLocatableException, javax.agent.service.transport.TransportFailure, MessageNotRepliedToException, IUnknown.UNKNOWN, ITruthValue.TRUE, ITruthValue.FALSE, ITruthValue.UNKNOWN