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

java.lang.Object
  extended by gov.nasa.arc.brahms.common.rt.BrahmsObjectCtx
      extended by gov.nasa.arc.brahms.common.rt.ActivityCtx
          extended by gov.nasa.arc.brahms.vm.rt.VMActivityCtx
              extended by gov.nasa.arc.brahms.vm.rt.VMPrimitiveActivityCtx
                  extended by gov.nasa.arc.brahms.vm.rt.VMContainmentActivityCtx
                      extended by gov.nasa.arc.brahms.vm.rt.VMPutActivityCtx
All Implemented Interfaces:
IActivityCtx, IBrahmsObjectCtx, IContainmentActivityCtx, IPrimitiveActivityCtx, IPutActivityCtx, IRuntimeConstants, gov.nasa.arc.brahms.vm.events.IDiscreteEventData, gov.nasa.arc.brahms.vm.events.IDiscreteEventHandler, java.io.Serializable

public class VMPutActivityCtx
extends VMContainmentActivityCtx
implements IPutActivityCtx

A VMPutActivityCtx is a PutActivityCtx with extensions for the virtual machine that maintains the context of a put activity being or to be executed by an active instance. The context maintains the start and end times for an activity, the duration, priority, status, randomness, duration, resources, what items (agent or objects) were dropped off in the activity and when the activity was executed.

Version:
$Revision: 1.2 $ $Date: 2008/02/28 18:33:05 $ $Author: rvhoof $
Author:
Ron van Hoof
See Also:
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
  VMPutActivityCtx(VMPutActivity act)
          Constructor, creates a new context for the specified VMPutActivity.
protected VMPutActivityCtx(VMPutActivity act, java.lang.String id)
          Constructor, creates a new context for the specified VMPutActivity.
 
Method Summary
protected  void doActivityAction(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
          Drops the items specified in the activity that are being carried by the the agent or object performing the activity.
 ParameterCtx getDestination()
          Returns the put activity's destination agent.
protected  void sendAbortEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
          Sends an abort event to the event notifier.
protected  void sendCompleteEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
          Sends a complete event to the event notifier.
protected  void sendContinueEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
          Sends a continue event to the event notifier.
protected  void sendContinueFromImpasseEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
          Sends a continue from impasse event to the event notifier.
protected  void sendEndEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
          Sends an end event to the event notifier.
protected  void sendImpasseEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
          Sends an impasse event to the event notifier.
protected  void sendInterruptEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
          Sends an interrupt event to the event notifier.
protected  void sendStartEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
          Sends a start event to the event notifier.
 
Methods inherited from class gov.nasa.arc.brahms.vm.rt.VMContainmentActivityCtx
addItem, getItemCount, getItems, getWhen, onEnd, onStart, removeItem
 
Methods inherited from class gov.nasa.arc.brahms.vm.rt.VMPrimitiveActivityCtx
addResource, getDuration, getElapsedTime, getMaxDuration, getMinDuration, getRandom, getResourceCount, getResources, removeResource, setElapsedTime
 
Methods inherited from class gov.nasa.arc.brahms.vm.rt.VMActivityCtx
getDisplayText, getParameterCtx, getPriority, handleDiscreteEvent, handleDiscreteEvent, onAbort, onComplete, onContinue, onContinueFromImpasse, onImpasse, onInterrupt, resolveParameters
 
Methods inherited from class gov.nasa.arc.brahms.common.rt.ActivityCtx
getCompletionCause, getParentFrame, getPerformedBy, getReferencedBy, getState, getStatus, setCompletionCause, setDisplayText, setParentFrame, setPerformedBy, setPriority, setReferencedBy, setState, setState, setStatus, 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.IContainmentActivityCtx
addItem, getItemCount, getItems, getWhen, removeItem
 
Methods inherited from interface gov.nasa.arc.brahms.common.rt.IPrimitiveActivityCtx
addResource, getDuration, getElapsedTime, getMaxDuration, getMinDuration, getRandom, getResourceCount, getResources, removeResource, setElapsedTime
 
Methods inherited from interface gov.nasa.arc.brahms.common.rt.IActivityCtx
getCompletionCause, getDisplayText, getParentFrame, getPerformedBy, getPriority, getReferencedBy, getStatus, setCompletionCause, setDisplayText, setParentFrame, setPerformedBy, setReferencedBy, setStatus
 
Methods inherited from interface gov.nasa.arc.brahms.common.rt.IBrahmsObjectCtx
addNote, getContextFor, getEndTime, getID, getNote, getNotes, getStartTime, removeNote, setEndTime, setID, setStartTime
 

Constructor Detail

VMPutActivityCtx

public VMPutActivityCtx(VMPutActivity act)
Constructor, creates a new context for the specified VMPutActivity.

Parameters:
act - the VMPutActivity for which to create a context

VMPutActivityCtx

protected VMPutActivityCtx(VMPutActivity act,
                           java.lang.String id)
Constructor, creates a new context for the specified VMPutActivity.

Parameters:
act - the VMPutActivity for which to create a context
id - the unique identifier for the activity context
Method Detail

getDestination

public ParameterCtx getDestination()
                            throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the put activity's destination agent. object or area. The destination is specified through a parameter context containing either the actual value (ConceptCtx) or a reference to a variable containing the value.

Specified by:
getDestination in interface IPutActivityCtx
Returns:
ParameterCtx the destination, null if no destination is specified
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an internal error occurs

doActivityAction

protected void doActivityAction(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Drops the items specified in the activity that are being carried by the the agent or object performing the activity. The activity generates the appropriate facts and beliefs stating that the carrying agent/object no longer contains the items. The items will also be placed in the location of the carrying agent/object causing the generation of the appropriate location facts and beliefs.

Specified by:
doActivityAction in class VMContainmentActivityCtx
Parameters:
evt - the DiscreteEvent that triggered the execution of the code

sendStartEvent

protected void sendStartEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Sends a start event to the event notifier.

Note that this method is created for the different implementations by the sub classes of VMActivityCtx.

Overrides:
sendStartEvent in class VMPrimitiveActivityCtx
Parameters:
evt - the DiscreteEvent that triggered the state change

sendEndEvent

protected void sendEndEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Sends an end event to the event notifier.

Note that this method is created for the different implementations by the sub classes of VMActivityCtx.

Overrides:
sendEndEvent in class VMPrimitiveActivityCtx
Parameters:
evt - the DiscreteEvent that triggered the state change

sendInterruptEvent

protected void sendInterruptEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Sends an interrupt event to the event notifier.

Note that this method is created for the different implementations by the sub classes of VMActivityCtx.

Overrides:
sendInterruptEvent in class VMPrimitiveActivityCtx
Parameters:
evt - the DiscreteEvent that triggered the state change

sendContinueEvent

protected void sendContinueEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Sends a continue event to the event notifier.

Note that this method is created for the different implementations by the sub classes of VMActivityCtx.

Overrides:
sendContinueEvent in class VMPrimitiveActivityCtx
Parameters:
evt - the DiscreteEvent that triggered the state change

sendImpasseEvent

protected void sendImpasseEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Sends an impasse event to the event notifier.

Note that this method is created for the different implementations by the sub classes of VMActivityCtx.

Overrides:
sendImpasseEvent in class VMPrimitiveActivityCtx
Parameters:
evt - the DiscreteEvent that triggered the state change

sendContinueFromImpasseEvent

protected void sendContinueFromImpasseEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Sends a continue from impasse event to the event notifier.

Note that this method is created for the different implementations by the sub classes of VMActivityCtx.

Overrides:
sendContinueFromImpasseEvent in class VMPrimitiveActivityCtx
Parameters:
evt - the DiscreteEvent that triggered the state change

sendCompleteEvent

protected void sendCompleteEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Sends a complete event to the event notifier.

Note that this method is created for the different implementations by the sub classes of VMActivityCtx.

Overrides:
sendCompleteEvent in class VMPrimitiveActivityCtx
Parameters:
evt - the DiscreteEvent that triggered the state change

sendAbortEvent

protected void sendAbortEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Sends an abort event to the event notifier.

Note that this method is created for the different implementations by the sub classes of VMActivityCtx.

Overrides:
sendAbortEvent in class VMPrimitiveActivityCtx
Parameters:
evt - the DiscreteEvent that triggered the state change


Copyright © 1997-2012 All Rights Reserved.