gov.nasa.arc.brahms.common.rt
Interface IActiveInstanceCtx

All Superinterfaces:
IBrahmsObjectCtx, IConceptCtx
All Known Subinterfaces:
IAgentCtx, IObjectInstanceCtx
All Known Implementing Classes:
ActiveInstanceCtx, AgentCtx, ObjectInstanceCtx, VMActiveInstanceCtx, VMAgentCtx, VMExternalAgentCtx, VMObjectInstanceCtx

public interface IActiveInstanceCtx
extends IConceptCtx

The IActiveInstanceCtx is the interface for the runtime class for active instances (agents and object instances). It manages the belief set, location, frame contexts with their various states and containment. The virtual machine maintains the active instances states through the active instance contexts.

Version:
$Revision: 1.3 $ $Date: 2008/09/26 17:59:31 $ $Author: rvhoof $
Author:
Ron van Hoof

Method Summary
 void addAvailableFrame(IFrameCtx frame)
          Adds the specified frame context as an available frame.
 void addBelief(IBeliefCtx belief)
          Add a new belief to the belief set of the active instance.
 void addCompletedFrame(IFrameCtx frame)
          Adds the given frame context as a completed frame.
 void addContainedElement(ContainedInstanceCtx ci)
          Adds the given contained element to the list of elements carried or contained by this active instance.
 void addImpasseDetectable(IDetectableCtx detectable)
          Adds the specified detectable causing an impasse to the list of impasse causing detectables.
 void addImpassedFrame(IWorkframeCtx frame)
          Adds the specified frame context as an impassed frame.
 void addInterruptedFrame(IWorkframeCtx frame)
          Adds the specified frame context as an interrupted frame.
 void addPastLocation(IAreaCtx location)
          Adds the given location to the list of past location visited by the active instance.
 java.util.ListIterator getAvailableThoughtframes()
          Returns a list of all the available thoughtframes.
 java.util.ListIterator getAvailableWorkframes()
          Returns a list of all the available workframes.
 java.util.Enumeration getBeliefs()
          Returns the active instance's belief set.
 long getBelievedTime()
          Returns the active instance's believed date and time (can but is not necessarily the same as the actual current time as managed by the Scheduler)
 java.util.Set<java.lang.String> getCompletedThoughtframeNames()
          Return a list of the fully qualified names for all the thoughtframes for which completed thoughtframe contexts exist.
 java.util.ListIterator getCompletedThoughtframes(java.lang.String frameName)
          Return a list of all the completed thoughtframe contexts for the thoughtframe with the specified fully qualified name.
 java.util.Set<java.lang.String> getCompletedWorkframeNames()
          Return a list of the fully qualified names for all the workframes for which completed workframe contexts exist.
 java.util.ListIterator getCompletedWorkframes(java.lang.String frameName)
          Return a list of all the completed workframe contexts for the workframe with the specified fully qualified name.
 java.util.Enumeration getContainedElements()
          Returns the active instance's carried or contained elements.
 IWorkframeCtx getCurrentWork()
          Returns the workframe currently active for the active instance.
 java.util.ListIterator getImpasseDetectables()
          Returns the list of detectables causing an impasse.
 java.util.ListIterator getImpassedFrames()
          Returns a list of all the impassed workframes.
 java.util.ListIterator getInterruptedFrames()
          Returns a list of all the interrupted workframes.
 IAreaCtx getLocation()
          Returns the current location of the active instance.
 java.util.Enumeration getPastLocations()
          Returns the active instance's past locations.
 boolean hasAvailableThoughtframes()
          Inficates whether there are any available thoughtframes.
 boolean hasAvailableWorkframes()
          Inficates whether there are any available workframes.
 boolean hasCompletedThoughtframes()
          Inficates whether there are any completed thoughtframes.
 boolean hasCompletedWorkframes()
          Inficates whether there are any completed workframes.
 boolean hasImpassedFrames()
          Inficates whether there are any impassed workframes.
 boolean hasInterruptedFrames()
          Inficates whether there are any interrupted workframes.
 void removeAllAvailableFrames()
          Removes all the available frames, work and thoughtframes.
 void removeAllBeliefs()
          Clears the active instance's belief set.
 void removeAllCompletedFrames()
          Removes all the completed frames, work and thoughtframes.
 void removeAllContainedElements()
          Clears the active instance's list containing the contained elements.
 void removeAllImpasseDetectables()
          Removes all the detectables causing an impasse.
 void removeAllImpassedFrames()
          Removes all the impassed frames.
 void removeAllInterruptedFrames()
          Removes all the interrupted frames.
 void removeAllPastLocations()
          Clears the active instance's list containing past locations.
 void removeAvailableFrame(IFrameCtx frame)
          Removes the specifies frame as an available frame.
 void removeBelief(IBeliefCtx belief)
          Removes the specified belief from the belief set of the active instance.
 void removeCompletedFrame(IFrameCtx frame)
          Removes the given frame context as a completed frame context
 void removeContainedElement(ContainedInstanceCtx ci)
          Removes the specified contained element from the list of elements carried or contained by this active instance.
 void removeImpasseDetectable(IDetectableCtx detectable)
          Removes the specified detectable causing an impasse from the list of impasse causing detectables.
 void removeImpassedFrame(IWorkframeCtx frame)
          Removes the specified frame context as an impassed frame.
 void removeInterruptedFrame(IWorkframeCtx frame)
          Removes the specified frame context as an interrupted frame.
 void removePastLocation(IAreaCtx location)
          Removes the specified location from the list of the active instance's past locations.
 void setBelievedTime(long time)
          Sets the active instance's believed date and time (can but is not necessarily the same as the actual current time as managed by the Scheduler)
 void setCurrentWork(IWorkframeCtx frame)
          Sets the workframe currently active for the active instance
 void setLocation(IAreaCtx location)
          Sets the current location of the active instance.
 
Methods inherited from interface gov.nasa.arc.brahms.common.rt.IBrahmsObjectCtx
addNote, getContextFor, getEndTime, getID, getNote, getNotes, getStartTime, removeNote, setEndTime, setID, setStartTime
 

Method Detail

setBelievedTime

void setBelievedTime(long time)
                     throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the active instance's believed date and time (can but is not necessarily the same as the actual current time as managed by the Scheduler)

Parameters:
time - the date and time in milliseconds
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an invalid time (< 0) is specified
See Also:
Date.getTime()

getBelievedTime

long getBelievedTime()
Returns the active instance's believed date and time (can but is not necessarily the same as the actual current time as managed by the Scheduler)

Returns:
long the date and time in milliseconds

addBelief

void addBelief(IBeliefCtx belief)
               throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Add a new belief to the belief set of the active instance.

Parameters:
belief - the IBeliefCtx to be added to the belief set.
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if a null belief is passed

removeBelief

void removeBelief(IBeliefCtx belief)
                  throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Removes the specified belief from the belief set of the active instance.

Parameters:
belief - the IBeliefCtx to be removed from the belief set.
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if a null belief is passed, no beliefs are present or the specified belief is not present

getBeliefs

java.util.Enumeration getBeliefs()
                                 throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the active instance's belief set.

Returns:
Enumeration an enumeration of BeliefCtx's
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if active instance has no beliefs

removeAllBeliefs

void removeAllBeliefs()
Clears the active instance's belief set.


setLocation

void setLocation(IAreaCtx location)
Sets the current location of the active instance.

Parameters:
location - the current location (IAreaCtx) of the active instance or null if not in a location.

getLocation

IAreaCtx getLocation()
Returns the current location of the active instance.

Returns:
IAreaCtx the current location of the active instance, null if the active instance is not in a specific location

addPastLocation

void addPastLocation(IAreaCtx location)
                     throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Adds the given location to the list of past location visited by the active instance.

Note: The location (AreaCtx) given must not be an area context used for actively maintaining actual location information. The context should be a separate area context referencing an Area defining the the time the active instance entered the area and the time the active instance left the area (start and end time).

Parameters:
location - the IAreaCtx to be added to the active instance's location history
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if the specified location is null.

removePastLocation

void removePastLocation(IAreaCtx location)
                        throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Removes the specified location from the list of the active instance's past locations.

Parameters:
location - the IAreaCtx to be removed from the list of past locations.
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if a null location is specified, no past locations are present or the specified location is not present

getPastLocations

java.util.Enumeration getPastLocations()
                                       throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the active instance's past locations.

Returns:
Enumeration an enumeration of AreaCtx's
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if active instance has no past locations

removeAllPastLocations

void removeAllPastLocations()
Clears the active instance's list containing past locations.


addContainedElement

void addContainedElement(ContainedInstanceCtx ci)
                         throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Adds the given contained element to the list of elements carried or contained by this active instance.

Parameters:
ci - the ContainedInstanceCtx to be added as the element contained by this active instance
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if the specified contained element is null.

removeContainedElement

void removeContainedElement(ContainedInstanceCtx ci)
                            throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Removes the specified contained element from the list of elements carried or contained by this active instance.

Parameters:
ci - the ContainedInstanceCtx to be removed.
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if a null contained element is specified, no contained elements are present or the specified contained element is not present

getContainedElements

java.util.Enumeration getContainedElements()
                                           throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the active instance's carried or contained elements.

Returns:
Enumeration an enumeration of ContainedInstanceCtx's
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if active instance has no contained elements

removeAllContainedElements

void removeAllContainedElements()
Clears the active instance's list containing the contained elements.


addAvailableFrame

void addAvailableFrame(IFrameCtx frame)
                       throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Adds the specified frame context as an available frame.

Parameters:
frame - the available work or thoughtframe
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if frame is null

removeAvailableFrame

void removeAvailableFrame(IFrameCtx frame)
                          throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Removes the specifies frame as an available frame.

Parameters:
frame - the frame to be removed as an available frame.
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if a null frame is specified, no available frames are present or the specified frame is not present

getAvailableWorkframes

java.util.ListIterator getAvailableWorkframes()
                                              throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns a list of all the available workframes.

Returns:
ListIterator an iterator returning a list of IWorkframeCtx
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if there are no available workframes

hasAvailableWorkframes

boolean hasAvailableWorkframes()
Inficates whether there are any available workframes.

Returns:
boolean true if there are one or more available workframe instantiations, false otherwise

getAvailableThoughtframes

java.util.ListIterator getAvailableThoughtframes()
                                                 throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns a list of all the available thoughtframes.

Returns:
ListIterator an iterator returning a list of IThoughtframeCtx
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if there are no available thoughtframes

hasAvailableThoughtframes

boolean hasAvailableThoughtframes()
Inficates whether there are any available thoughtframes.

Returns:
boolean true if there are one or more available thoughtframe instantiations, false otherwise

removeAllAvailableFrames

void removeAllAvailableFrames()
Removes all the available frames, work and thoughtframes.


addInterruptedFrame

void addInterruptedFrame(IWorkframeCtx frame)
                         throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Adds the specified frame context as an interrupted frame.

Parameters:
frame - the interrupted workframe to be added
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if frame is null

removeInterruptedFrame

void removeInterruptedFrame(IWorkframeCtx frame)
                            throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Removes the specified frame context as an interrupted frame.

Parameters:
frame - the interrupted workframe to be removed
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if frame is null, no interrupted frames are available, or the frame is not present as an interrupted frame

getInterruptedFrames

java.util.ListIterator getInterruptedFrames()
                                            throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns a list of all the interrupted workframes.

Returns:
ListIterator an iterator returning a list of IWorkframeCtx
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if there are no interrupted workframes

hasInterruptedFrames

boolean hasInterruptedFrames()
Inficates whether there are any interrupted workframes.

Returns:
boolean true if there are one or more interrupted workframe instantiations, false otherwise

removeAllInterruptedFrames

void removeAllInterruptedFrames()
Removes all the interrupted frames.


addImpassedFrame

void addImpassedFrame(IWorkframeCtx frame)
                      throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Adds the specified frame context as an impassed frame.

Parameters:
frame - the impassed workframe to be added
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if frame is null

removeImpassedFrame

void removeImpassedFrame(IWorkframeCtx frame)
                         throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Removes the specified frame context as an impassed frame.

Parameters:
frame - the impassed workframe to be removed
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if frame is null, no impassed frames are available, or the frame is not present as an impassed frame

getImpassedFrames

java.util.ListIterator getImpassedFrames()
                                         throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns a list of all the impassed workframes.

Returns:
ListIterator an iterator returning a list of IWorkframeCtx
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if there are no impassed workframes

hasImpassedFrames

boolean hasImpassedFrames()
Inficates whether there are any impassed workframes.

Returns:
boolean true if there are one or more impassed workframe instantiations, false otherwise

removeAllImpassedFrames

void removeAllImpassedFrames()
Removes all the impassed frames.


addCompletedFrame

void addCompletedFrame(IFrameCtx frame)
                       throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Adds the given frame context as a completed frame. This method is used by the virtual machine to store non repearing frames and this method can be used by other components to store a history of executed frames.

Parameters:
frame - the IFrameCtx to be added as a completed frame
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if frame context is null or frame context references no frame

removeCompletedFrame

void removeCompletedFrame(IFrameCtx frame)
                          throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Removes the given frame context as a completed frame context

Parameters:
frame - the frame context to be removed
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if frame is null, no completed frames exist for the frame for which the specified frame is a context or if the specified frame context is not found or if the specified frame is not referencing a workframe or thoughtframe

getCompletedWorkframes

java.util.ListIterator getCompletedWorkframes(java.lang.String frameName)
                                              throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Return a list of all the completed workframe contexts for the workframe with the specified fully qualified name.

Parameters:
frameName - the fully qualified name for the workframe
Returns:
ListIterator the list of completed IWorkframeCtx
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an invalid name is specified or no completed frames exist

getCompletedWorkframeNames

java.util.Set<java.lang.String> getCompletedWorkframeNames()
                                                           throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Return a list of the fully qualified names for all the workframes for which completed workframe contexts exist.

Returns:
Set the names of workframes for which completed IWorkframeCtx exist
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no completed frames exist

hasCompletedWorkframes

boolean hasCompletedWorkframes()
Inficates whether there are any completed workframes.

Returns:
boolean true if there are one or more completed workframe instantiations, false otherwise

getCompletedThoughtframes

java.util.ListIterator getCompletedThoughtframes(java.lang.String frameName)
                                                 throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Return a list of all the completed thoughtframe contexts for the thoughtframe with the specified fully qualified name.

Parameters:
frameName - the fully qualified name for the thoughtframe
Returns:
ListIterator the list of completed IThoughtframeCtx
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an invalid name is specified or no completed frames exist

getCompletedThoughtframeNames

java.util.Set<java.lang.String> getCompletedThoughtframeNames()
                                                              throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Return a list of the fully qualified names for all the thoughtframes for which completed thoughtframe contexts exist.

Returns:
Set the names of thoughtframes for which completed IThoughtframeCtx exist
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no completed frames exist

hasCompletedThoughtframes

boolean hasCompletedThoughtframes()
Inficates whether there are any completed thoughtframes.

Returns:
boolean true if there are one or more completed thoughtframe instantiations, false otherwise

removeAllCompletedFrames

void removeAllCompletedFrames()
Removes all the completed frames, work and thoughtframes.


setCurrentWork

void setCurrentWork(IWorkframeCtx frame)
Sets the workframe currently active for the active instance

Parameters:
frame - the current work (IWorkframeCtx) of the active instance

getCurrentWork

IWorkframeCtx getCurrentWork()
Returns the workframe currently active for the active instance. Thoughtframes are not considered current work as they take no time.

Returns:
IWorkframeCtx the current work of the active instance, null if the active instance is not working on anything

addImpasseDetectable

void addImpasseDetectable(IDetectableCtx detectable)
                          throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Adds the specified detectable causing an impasse to the list of impasse causing detectables.

Parameters:
detectable - the IDetectableCtx for the detectable causing an impasse
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if the detectable is null

removeImpasseDetectable

void removeImpasseDetectable(IDetectableCtx detectable)
                             throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Removes the specified detectable causing an impasse from the list of impasse causing detectables.

Parameters:
detectable - the IDetectableCtx for the detectable causing an impasse to be removed
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if the detectable is null or no impasse causing detectables exist or the specified detectable is not found

getImpasseDetectables

java.util.ListIterator getImpasseDetectables()
                                             throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the list of detectables causing an impasse.

Returns:
ListIterator the list of detectables (IDetectableCtx) causing an impasse
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no detectables causing an impasse exist

removeAllImpasseDetectables

void removeAllImpasseDetectables()
Removes all the detectables causing an impasse.



Copyright © 1997-2012 All Rights Reserved.