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

All Superinterfaces:
IActivityCtx, IBrahmsObjectCtx
All Known Subinterfaces:
IBroadcastActivityCtx, ICommunicateActivityCtx, IContainmentActivityCtx, ICreateAgentActivityCtx, ICreateAreaActivityCtx, ICreateObjectActivityCtx, IGestureActivityCtx, IGetActivityCtx, IJavaActivityCtx, IMoveActivityCtx, IPutActivityCtx
All Known Implementing Classes:
BroadcastActivityCtx, CommunicateActivityCtx, ContainmentActivityCtx, CreateAgentActivityCtx, CreateAreaActivityCtx, CreateObjectActivityCtx, GestureActivityCtx, GetActivityCtx, JavaActivityCtx, MoveActivityCtx, PrimitiveActivityCtx, PutActivityCtx, VMBroadcastActivityCtx, VMCommunicateActivityCtx, VMContainmentActivityCtx, VMCreateAgentActivityCtx, VMCreateAreaActivityCtx, VMCreateObjectActivityCtx, VMGestureActivityCtx, VMGetActivityCtx, VMJavaActivityCtx, VMMoveActivityCtx, VMPrimitiveActivityCtx, VMPutActivityCtx

public interface IPrimitiveActivityCtx
extends IActivityCtx

The IPrimitiveActivityCtx is the interface for primitive activity contexts. A PrimitiveActivityCtx maintains the context of a primitive 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 and resources.

Version:
28 July 2000
Author:
Ron van Hoof

Method Summary
 void addResource(ParameterCtx resource)
          Adds the specified resource as a resource for this activity.
 long getDuration()
          Returns the calculated duration of the activity used by the VM
 long getElapsedTime()
          Returns the elapsed time when the activity has been active
 ParameterCtx getMaxDuration()
          Returns the maximum duration of the activity.
 ParameterCtx getMinDuration()
          returns the minimum duration of the activity.
 ParameterCtx getRandom()
          Returns whether the duration of the activity is random or not.
 int getResourceCount()
          Return the number of resources associated with the activity.
 java.util.Enumeration getResources()
          Returns a list of all the resources (ParameterCtx).
 void removeResource(ParameterCtx resource)
          Removes the specified resource as a resource for this activity.
 void setElapsedTime(long elapsedTime)
          Specifies the elapsed time when the activity has been active
 
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
 

Method Detail

getRandom

ParameterCtx getRandom()
                       throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns whether the duration of the activity is random or not. The random indicator is set through a parameter context containing either the actual value or a reference to a variable containing the random value.

Returns:
ParameterCtx containing a boolean value defining whether the activity duration is random
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no random indicator is specified

getMinDuration

ParameterCtx getMinDuration()
                            throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
returns the minimum duration of the activity. The minimum duration is set through a parameter context containing either the actual value or a reference to a variable containing the value.

Returns:
ParameterCtx containing an integer value defining the minimum duration of the activity
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no minimum duration is specified

getMaxDuration

ParameterCtx getMaxDuration()
                            throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the maximum duration of the activity. The maximum duration is set through a parameter context containing either the actual value or a reference to a variable containing the value.

Returns:
ParameterCtx containing an integer value defining the maximum duration of the activity
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no maximum duration is specified

getDuration

long getDuration()
Returns the calculated duration of the activity used by the VM

Returns:
long the total duration of the activity

setElapsedTime

void setElapsedTime(long elapsedTime)
Specifies the elapsed time when the activity has been active

Parameters:
elapsedTime - the activities elapsed time

getElapsedTime

long getElapsedTime()
Returns the elapsed time when the activity has been active

Returns:
long the activities elapsed time

addResource

void addResource(ParameterCtx resource)
                 throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Adds the specified resource as a resource for this activity. The actual resource is the concept referenced by the parameter context where the parameter context specifies when the resource was associated with the activity.

Parameters:
resource - the resource (ParameterCtx) to be added
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if resource is null

removeResource

void removeResource(ParameterCtx resource)
                    throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Removes the specified resource as a resource for this activity. The actual resource is the concept referenced by the parameter context where the parameter context specifies when the resource was (dis)associated with the activity.

Parameters:
resource - the resource (ParameterCtx) to be removed
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if resource is null, no resources are available, or the resource is not found

getResources

java.util.Enumeration getResources()
                                   throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns a list of all the resources (ParameterCtx).

Returns:
Enumeration an enumeration of ParameterCtx
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if there are no resources

getResourceCount

int getResourceCount()
Return the number of resources associated with the activity.

Returns:
int the number of resources


Copyright © 1997-2012 All Rights Reserved.