gov.nasa.arc.brahms.vm.rt
Class VMAgentCtx

java.lang.Object
  extended by gov.nasa.arc.brahms.common.rt.BrahmsObjectCtx
      extended by gov.nasa.arc.brahms.common.rt.ConceptCtx
          extended by gov.nasa.arc.brahms.common.rt.ActiveInstanceCtx
              extended by gov.nasa.arc.brahms.vm.rt.VMActiveInstanceCtx
                  extended by gov.nasa.arc.brahms.vm.rt.VMAgentCtx
All Implemented Interfaces:
IActiveInstanceCtx, IAgentCtx, IBrahmsObjectCtx, IConceptCtx, IRuntimeConstants, gov.nasa.arc.brahms.vm.engine.IPriorityWorkManager, gov.nasa.arc.brahms.vm.engine.IWorkManager, gov.nasa.arc.brahms.vm.memory.IMemoryManagedElement, gov.nasa.arc.brahms.vm.monitoring.IMonitoredAgent, IFrameStatusListener, IRuntimeConceptCtx, java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener
Direct Known Subclasses:
VMExternalAgentCtx

public class VMAgentCtx
extends VMActiveInstanceCtx
implements IAgentCtx

The VMAgentCtx is the runtime class for the agents with extensions for it to function in the Brahms virtual machine. It manages the belief set, location, frame contexts with their various states and containment. The virtual machine maintains the agent states through the agent contexts.

Version:
7 January 2004
Author:
Ron van Hoof
See Also:
IAgentCtx, Serialized Form

Field Summary
 
Fields inherited from class gov.nasa.arc.brahms.vm.rt.VMActiveInstanceCtx
m_bInitialized, m_llCIMessageQueue, m_llReceivedMessageConversationIds, m_oBeliefSet, m_oEngine, m_oIncomingMessageLock
 
Fields inherited from interface gov.nasa.arc.brahms.common.rt.IRuntimeConstants
ABORTED, ACTIVE, ACTIVITY, AVAILABLE, COMPLETED, CONSEQUENCE, DETECTABLE, ENDED, ENGINE, EXTERNAL_AGENT, FROM, IMPASSED, INITIAL, INTERRUPTED, JAVA_PROPERTY, sABORTED, sACTIVE, sAVAILABLE, sCOMPLETED, sENDED, sIMPASSED, sINTERRUPTED, sUNAVAILABLE, TO, TRANSFER, UNAVAILABLE
 
Constructor Summary
VMAgentCtx(Agent agt)
          Constructor, creates a new context for the specified agent.
 
Method Summary
protected  gov.nasa.arc.brahms.vm.engine.IEngine createEngine(gov.nasa.arc.brahms.vm.controller.VMController vmc)
          Creates a new engine for this active concept for use in a virtual machine
 int getMatchingStrategy(VMFrameCtx frame)
          Determines whether the active instance attempts to match facts or beliefs when evaluating OA operands that occur in expressions in the body of the given frame context.
 
Methods inherited from class gov.nasa.arc.brahms.vm.rt.VMActiveInstanceCtx
activateCompositeActivity, addActiveDetectable, addBelief, addDeletedListener, addEventReference, addFrameBindingReference, addHardReference, addKnowsLocationOf, addSoftReference, addStatementReference, addStatusListener, clearKnowsLocationOf, containsBelief, createWorkSelector, deactivateCompositeActivity, deregisterForMonitoring, deregisterThreadListener, detect, doWork, finalizeDelete, getActiveDetectables, getBelief, getBelief, getBelief, getBelief, getBelief, getBelief, getBeliefChangeSupport, getBeliefForIndex, getBeliefForIndex, getBeliefRSN, getBeliefs, getBeliefs, getBeliefs, getBeliefs, getBeliefs, getBeliefs, getBeliefs, getBeliefs, getBeliefs, getBeliefs, getBeliefs, getBeliefs, getBeliefs, getBeliefs, getBeliefs, getBeliefsForIndex, getBeliefsForIndex, getContainedInstances, getContainsRelation, getContext, getController, getElement, getFactChangeSupport, getFactRSN, getKnowsLocationOf, getLocationAttribute, getPriorityAvailableThoughtframe, getPriorityAvailableWorkframe, getPriorityInterruptedFrame, getRemoteBeliefs, getRemovedBeliefs, getSoftReferences, getStatusListeners, hasAddedBelief, hasEventReferences, hasFrames, hasRemovedBelief, hasSoftReferences, initialize, initializeMemoryManagement, initiateDelete, isAcceptingFacts, isDeleted, isDeleteInitiated, isMarkedForGC, isSynchronizationRequired, knowsLocationOf, pause, postEvent, process, processMessage, propertyChange, registerForMonitoring, registerJavaObject, registerThreadListener, removeActiveDetectable, removeAllBeliefs, removeBelief, removeEventReference, removeFrameBindingReference, removeHardReference, removeKnowsLocationOf, removeSoftReference, removeStatementReference, removeStatusListener, reset, resume, retractEvent, setBeliefChangeSupport, setController, setFactChangeSupport, setMarkedForGC, setSynchronizationRequired, start, statusChanged, stop, trigger, triggerImpasseResolution, unregisterJavaObject
 
Methods inherited from class gov.nasa.arc.brahms.common.rt.ActiveInstanceCtx
addAvailableFrame, addBelief, addCompletedFrame, addContainedElement, addImpasseDetectable, addImpassedFrame, addInterruptedFrame, addPastLocation, getAvailableThoughtframes, getAvailableWorkframes, getBelievedTime, getCompletedThoughtframeNames, getCompletedThoughtframes, getCompletedWorkframeNames, getCompletedWorkframes, getContainedElements, getCurrentWork, getImpasseDetectables, getImpassedFrames, getInterruptedFrames, getLocation, getPastLocations, hasAvailableThoughtframes, hasAvailableWorkframes, hasCompletedThoughtframes, hasCompletedWorkframes, hasImpassedFrames, hasInterruptedFrames, removeAllAvailableFrames, removeAllCompletedFrames, removeAllContainedElements, removeAllImpasseDetectables, removeAllImpassedFrames, removeAllInterruptedFrames, removeAllPastLocations, removeAvailableFrame, removeBelief, removeCompletedFrame, removeContainedElement, removeImpasseDetectable, removeImpassedFrame, removeInterruptedFrame, removePastLocation, setBelievedTime, setCurrentWork, setLocation
 
Methods inherited from class gov.nasa.arc.brahms.common.rt.ConceptCtx
addAttribute, addRelation, getAttribute, getRelation, initAttributeRelationCache, removeAttribute, removeRelation, resetAttributeRelationCache, toString
 
Methods inherited from class gov.nasa.arc.brahms.common.rt.BrahmsObjectCtx
addNote, getContextFor, getEndTime, getID, getNote, getNotes, getStartTime, removeNote, setContextFor, setEndTime, setID, setStartTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gov.nasa.arc.brahms.common.rt.IActiveInstanceCtx
addAvailableFrame, addBelief, addCompletedFrame, addContainedElement, addImpasseDetectable, addImpassedFrame, addInterruptedFrame, addPastLocation, getAvailableThoughtframes, getAvailableWorkframes, getBeliefs, getBelievedTime, getCompletedThoughtframeNames, getCompletedThoughtframes, getCompletedWorkframeNames, getCompletedWorkframes, getContainedElements, getCurrentWork, getImpasseDetectables, getImpassedFrames, getInterruptedFrames, getLocation, getPastLocations, hasAvailableThoughtframes, hasAvailableWorkframes, hasCompletedThoughtframes, hasCompletedWorkframes, hasImpassedFrames, hasInterruptedFrames, removeAllAvailableFrames, removeAllBeliefs, removeAllCompletedFrames, removeAllContainedElements, removeAllImpasseDetectables, removeAllImpassedFrames, removeAllInterruptedFrames, removeAllPastLocations, removeAvailableFrame, removeBelief, removeCompletedFrame, removeContainedElement, removeImpasseDetectable, removeImpassedFrame, removeInterruptedFrame, removePastLocation, setBelievedTime, setCurrentWork, setLocation
 
Methods inherited from interface gov.nasa.arc.brahms.common.rt.IBrahmsObjectCtx
addNote, getContextFor, getEndTime, getID, getNote, getNotes, getStartTime, removeNote, setEndTime, setID, setStartTime
 
Methods inherited from interface gov.nasa.arc.brahms.vm.engine.IPriorityWorkManager
getCurrentWork
 

Constructor Detail

VMAgentCtx

public VMAgentCtx(Agent agt)
Constructor, creates a new context for the specified agent.

Parameters:
agt - the Agent for which to create a context
Method Detail

createEngine

protected gov.nasa.arc.brahms.vm.engine.IEngine createEngine(gov.nasa.arc.brahms.vm.controller.VMController vmc)
                                                      throws VMException
Creates a new engine for this active concept for use in a virtual machine

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

Specified by:
createEngine in class VMActiveInstanceCtx
Parameters:
vmc - the virtual machine controller controlling the active instance
Returns:
IEngine a new engine
Throws:
VMException - if an error occurs in creating the engine

getMatchingStrategy

public int getMatchingStrategy(VMFrameCtx frame)
Determines whether the active instance attempts to match facts or beliefs when evaluating OA operands that occur in expressions in the body of the given frame context. For agents the strategy is to match beliefs.

Specified by:
getMatchingStrategy in class VMActiveInstanceCtx
Parameters:
frame - a VMFrameCtx where an expression is being evaluated
Returns:
int a code indicating the matching strategy
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an error occurs in determining the strategy
See Also:
gov.nasa.arc.brahms.vm.data.BELIEFS


Copyright © 1997-2012 All Rights Reserved.