gov.nasa.arc.brahms.vm.data
Interface IVMComparison

All Known Implementing Classes:
VMObjectComparison, VMValueComparison

public interface IVMComparison

The IVMComparison interface is the interface for comparisons used in the virtual machine to specify the virtual machine extensions.

Version:
8 August 2001
Author:
Ron van Hoof

Field Summary
static int BELIEFS
          Specified as matching strategy to resolve OAs using beliefs from a specified agent
static int FACTS
          Specifies as matching strategy to resolve OAs using facts
static int NONE
          Specifies no matching strategy, OAs are not resolved
 
Method Summary
 void buildRSN(gov.nasa.arc.brahms.vm.engine.rsn.ReasoningStateNetwork rsn, gov.nasa.arc.brahms.vm.engine.rsn.IRSNFrameNode frame, gov.nasa.arc.brahms.vm.engine.rsn.RSNActivityRefNode actref, int modifier)
          Adds this comparison to the reasoning state network to build up a reasoning state network that maintains a state of what statements matched with the comparison.
 boolean evaluate(gov.nasa.arc.brahms.vm.engine.rsn.RSNFrameNode frame, int modifier, int truthvalue, gov.nasa.arc.brahms.vm.engine.rsn.RSNFrameNode.FrameEvaluationRecord evalRcd)
          Evaluates the comparison as part of a preconditioon determining whether or not the comparison has a successfull match with a statement.
 java.util.LinkedList getConcludingStatements(VMActiveInstanceCtx agent, VMFrameCtx frame, boolean updateJava)
          Matches the comparison with the belief set of the specified agent and creates the statements that would result from the comparison after the match.
 java.util.LinkedList getDetectableFacts(VMActiveInstanceCtx agent, VMFrameCtx frame)
          Matches the comparison with the fact set of the world and returns the statements that match with the left hand side of the comparison after resolving the left hand side.
 java.util.LinkedList getTransferableCommunicativeActs(VMActiveInstanceCtx agent, VMFrameCtx frame)
          Resolves the CommunicativeAct specified for the transfer definition to the (list of) CommunicativeAct(s) to be transferred.
 java.util.LinkedList getTransferableStatements(VMActiveInstanceCtx agent, VMFrameCtx frame, int truthvalue)
          Matches the comparison of a transfer definition with the belief set of the specified agent and returns the statements that match with the comparison after resolving the lhs and rhs.
 VMBeliefCtx hasTriggeringBelief(VMActiveInstanceCtx agent, VMFrameCtx frame, int truthvalue)
          Checks whether the specified agent has a belief that can activate the trigger for which this comparison is the condition.
 boolean isDetectableFact(VMFactCtx fact, VMActiveInstanceCtx agent, VMFrameCtx frame)
          Checks whether the specified fact can be detected by matching the fact against the left hand side of the comparison.
 boolean isTriggeringBelief(VMBeliefCtx belief, VMActiveInstanceCtx agent, VMFrameCtx frame, int truthvalue)
          Checks whether the specified belief can cause the activation of the trigger by matching the belief against the comparison.
 

Field Detail

NONE

static final int NONE
Specifies no matching strategy, OAs are not resolved

See Also:
Constant Field Values

FACTS

static final int FACTS
Specifies as matching strategy to resolve OAs using facts

See Also:
Constant Field Values

BELIEFS

static final int BELIEFS
Specified as matching strategy to resolve OAs using beliefs from a specified agent

See Also:
Constant Field Values
Method Detail

getConcludingStatements

java.util.LinkedList getConcludingStatements(VMActiveInstanceCtx agent,
                                             VMFrameCtx frame,
                                             boolean updateJava)
                                             throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Matches the comparison with the belief set of the specified agent and creates the statements that would result from the comparison after the match. If also the fact set is to be used (includeFacts = true) then the comparison is also matched with the facts in the fact set and statements are created that would result from the comparison after the match.

The comparison serves as an assignment where the rhs is matched and resolved and new statements are created preserving the left hand side and assigning it the value(s) matched on the right hand side. On the left hand side only the object is resolved to concepts if instead of a concept, current, a variable or a parameter is specified.

Note:This method is only usable with consequences, not with detectables, transfer definitions and preconditions. Left hand side of preconditions can contain expressions which are not handled by this method. Transfer definitions and detectables require rhs matching and not assignment.

Parameters:
agent - the agent with whom's belief set we need to match
frame - the frame containing variable contexts for variables used by the comparison.
updateJava - whether to update Java objects as a side effect of determining the concluded statements
Returns:
LinkedList containing a list of Statements resulting from the comparison
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an error occurs in retrieving information from the static or dynamic model

getTransferableCommunicativeActs

java.util.LinkedList getTransferableCommunicativeActs(VMActiveInstanceCtx agent,
                                                      VMFrameCtx frame)
                                                      throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Resolves the CommunicativeAct specified for the transfer definition to the (list of) CommunicativeAct(s) to be transferred.

Parameters:
agent - the agent initiating the communication
frame - the frame containing variable contexts for variables used by the comparison.
Returns:
LinkedList containing a list of VMObjectCtx for the matching CommunicativeActs
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an error occurs in retrieving information from the static or dynamic model

getTransferableStatements

java.util.LinkedList getTransferableStatements(VMActiveInstanceCtx agent,
                                               VMFrameCtx frame,
                                               int truthvalue)
                                               throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Matches the comparison of a transfer definition with the belief set of the specified agent and returns the statements that match with the comparison after resolving the lhs and rhs.

Parameters:
agent - the agent with whom's belief set we need to match
frame - the frame containing variable contexts for variables used by the comparison.
truthvalue - the truth value of the comparison (TRUE, FALSE, UNKNOWN)
Returns:
LinkedList containing a list of VMBeliefCtx matching with the comparison
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an error occurs in retrieving information from the static or dynamic model
See Also:
IConstants.TRUE, IConstants.FALSE, IConstants.UNKNOWN

getDetectableFacts

java.util.LinkedList getDetectableFacts(VMActiveInstanceCtx agent,
                                        VMFrameCtx frame)
                                        throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Matches the comparison with the fact set of the world and returns the statements that match with the left hand side of the comparison after resolving the left hand side.

Note:This method is only usable with detectables as it limits the matching to facts in the world and only matches against the left hand side.

Parameters:
agent - the agent that is checking for detection
frame - the frame containing variable contexts for variables used by the comparison.
Returns:
LinkedList containing a list of VMFactCtx matching with the comparison
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an error occurs in retrieving information from the static or dynamic model

isDetectableFact

boolean isDetectableFact(VMFactCtx fact,
                         VMActiveInstanceCtx agent,
                         VMFrameCtx frame)
                         throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Checks whether the specified fact can be detected by matching the fact against the left hand side of the comparison. If the fact matches, the fact can be detected and true is returned, otherwise false is returned.

Parameters:
fact - the fact that is checked for detection
agent - the agent that is checking for detection
frame - the frame containing variable contexts for variables used by the comparison.
Returns:
true if the fact matches the comparison and can be detected, false otherwise
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an error occurs in retrieving information from the static or dynamic model

hasTriggeringBelief

VMBeliefCtx hasTriggeringBelief(VMActiveInstanceCtx agent,
                                VMFrameCtx frame,
                                int truthvalue)
                                throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Checks whether the specified agent has a belief that can activate the trigger for which this comparison is the condition. If the agent has a belief that matches the comparison then true is returned, otherwise false is returned.

Parameters:
agent - the agent that is checking the trigger and whom's belief set is checked for a matching belief
frame - the frame containing variable contexts for variables used by the comparison.
truthvalue - the specified truth value of the detectable condition (TRUE, FALSE, UNKNOWN)
Returns:
VMBeliefCtx the belief that matches the comparison and can activate the trigger, null of no belief matches the comparison
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an error occurs in retrieving information from the static or dynamic model
See Also:
IConstants.TRUE, IConstants.FALSE, IConstants.UNKNOWN

isTriggeringBelief

boolean isTriggeringBelief(VMBeliefCtx belief,
                           VMActiveInstanceCtx agent,
                           VMFrameCtx frame,
                           int truthvalue)
                           throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Checks whether the specified belief can cause the activation of the trigger by matching the belief against the comparison. If the belief matches, the belief can activate the trigger and true is returned, otherwise false is returned.

Parameters:
belief - the belief to be checked for activation of the trigger
agent - the agent that is checking the trigger
frame - the frame containing variable contexts for variables used by the comparison.
truthvalue - the specified truth value of the detectable condition (TRUE, FALSE, UNKNOWN)
Returns:
true if the belief matches the comparison and can activate the trigger, false otherwise
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an error occurs in retrieving information from the static or dynamic model
See Also:
IConstants.TRUE, IConstants.FALSE, IConstants.UNKNOWN

buildRSN

void buildRSN(gov.nasa.arc.brahms.vm.engine.rsn.ReasoningStateNetwork rsn,
              gov.nasa.arc.brahms.vm.engine.rsn.IRSNFrameNode frame,
              gov.nasa.arc.brahms.vm.engine.rsn.RSNActivityRefNode actref,
              int modifier)
              throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Adds this comparison to the reasoning state network to build up a reasoning state network that maintains a state of what statements matched with the comparison.

Parameters:
rsn - the ReasoningStateNetwork to be built
frame - the RSNFrameNode for the frame in which this comparison is used.
actref - the optional RSNActivityRefNode for the activity reference referencing a composite activity in which the frame and the precondition are specified.
modifier - the modifier of the (pre)condition
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an error occurs in building up the RSN with this comparison

evaluate

boolean evaluate(gov.nasa.arc.brahms.vm.engine.rsn.RSNFrameNode frame,
                 int modifier,
                 int truthvalue,
                 gov.nasa.arc.brahms.vm.engine.rsn.RSNFrameNode.FrameEvaluationRecord evalRcd)
                 throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Evaluates the comparison as part of a preconditioon determining whether or not the comparison has a successfull match with a statement. If so the comparison evaluates to true.

Parameters:
frame - the RSNFrameNode for the frame in which the comparison's precondition is specified
modifier - the modifier of the (pre)condition
truthvalue - the truthvalue of the (pre)condition (TRUE, FALSE, UNKNOWN)
evalRcd - the record in which to store bindings for variables and statements matching preconditions
Returns:
true if the comparison evaluates to true, false otherwise
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an internal error occurs
See Also:
IConstants.TRUE, IConstants.FALSE, IConstants.UNKNOWN


Copyright © 1997-2012 All Rights Reserved.