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

java.lang.Object
  extended by gov.nasa.arc.brahms.common.rt.BrahmsObjectCtx
      extended by gov.nasa.arc.brahms.common.rt.ConditionCtx
          extended by gov.nasa.arc.brahms.common.rt.ConsequenceCtx
              extended by gov.nasa.arc.brahms.vm.rt.VMConsequenceCtx
All Implemented Interfaces:
IBrahmsObjectCtx, IConditionCtx, IConsequenceCtx, IRuntimeConstants, gov.nasa.arc.brahms.vm.events.IDiscreteEventData, gov.nasa.arc.brahms.vm.events.IDiscreteEventHandler, java.io.Serializable

public class VMConsequenceCtx
extends ConsequenceCtx
implements gov.nasa.arc.brahms.vm.events.IDiscreteEventData, gov.nasa.arc.brahms.vm.events.IDiscreteEventHandler

The VMConsequenceCtx is a ConsequenceCtx with specializations for use in the virtual machine. A ConsequenceCtx defines the context for a fired consequence defining the consequence that was fired, what frame fired the consequence and defining what beliefs and/or facts were created by the consequence.

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

Field Summary
 
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
VMConsequenceCtx(Consequence consequence)
          Constructor, creates a new consequence context for the specified consequence.
 
Method Summary
 boolean handleDiscreteEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
          Process the specified discrete event.
 boolean handleDiscreteEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt, gov.nasa.arc.brahms.vm.events.IDiscreteEventHandlerFactory ehf)
          Handles the specified discrete event by selecting the appropriate event handler from the specified event handler factory.
protected  void onFire(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
          Fires the consequence
 
Methods inherited from class gov.nasa.arc.brahms.common.rt.ConsequenceCtx
addCreatedStatement, addUsedVariable, getCreatedStatements, getParent, getUsedVariables, removeCreatedStatement, removeUsedVariable, setParent, 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.IBrahmsObjectCtx
addNote, getContextFor, getEndTime, getID, getNote, getNotes, getStartTime, removeNote, setEndTime, setID, setStartTime
 

Constructor Detail

VMConsequenceCtx

public VMConsequenceCtx(Consequence consequence)
Constructor, creates a new consequence context for the specified consequence.

Parameters:
consequence - the fired consequence for which this context is the context
Method Detail

handleDiscreteEvent

public boolean handleDiscreteEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt,
                                   gov.nasa.arc.brahms.vm.events.IDiscreteEventHandlerFactory ehf)
Handles the specified discrete event by selecting the appropriate event handler from the specified event handler factory. The specified event contains as its data the object implementing this interface. The following should be the case: evt.getData() == this

Specified by:
handleDiscreteEvent in interface gov.nasa.arc.brahms.vm.events.IDiscreteEventData
Parameters:
evt - the DiscreteEvent to be handled
ehf - the EventHandlerFactory containing handlers from which this DiscreteEventData selects the appropriate handler
Returns:
boolean true if the event could be processed, false if not

handleDiscreteEvent

public boolean handleDiscreteEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Process the specified discrete event.

Specified by:
handleDiscreteEvent in interface gov.nasa.arc.brahms.vm.events.IDiscreteEventHandler
Parameters:
evt - the DiscreteEvent to be processed.
Returns:
boolean true if the event could be processed, false if not

onFire

protected void onFire(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Fires the consequence

Parameters:
evt - the DiscreteEvent that initiated the firing of the consequence


Copyright © 1997-2012 All Rights Reserved.