gov.nasa.arc.brahms.common.rt
Class CreateAreaActivityCtx

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.common.rt.PrimitiveActivityCtx
              extended by gov.nasa.arc.brahms.common.rt.CreateAreaActivityCtx
All Implemented Interfaces:
IActivityCtx, IBrahmsObjectCtx, ICreateAreaActivityCtx, IPrimitiveActivityCtx, IRuntimeConstants, java.io.Serializable

public class CreateAreaActivityCtx
extends PrimitiveActivityCtx
implements ICreateAreaActivityCtx

The CreateAreaActivityCtx maintains the context of a create area 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, parent area definition, aggregate area, destination variable, name of the destination area, and when the creation is to take place.

Version:
21 June 2002
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
CreateAreaActivityCtx(CreateAreaActivity act)
          Constructor, creates a new context for the specified CreateAreaActivity.
 
Method Summary
 void addBoundVariable(VariableCtx var)
          Adds the specified variable as a variable bound by this activity.
 void addInhabitant(ParameterCtx inhabitant)
          Adds the specified inhabitant (ParameterCtx) as a concept to be added as an inhabitant of the newly created area.
 java.util.Enumeration getBoundVariables()
          Returns a list of all the variables used by this activity.
 ParameterCtx getDestination()
          Returns the create area's destination variable.
 ParameterCtx getDestinationName()
          Returns the name for the created area.
 java.util.Enumeration getInhabitants()
          Returns a list of the agents or objects that have to be added as inhabitants to the new area.
 ParameterCtx getInstanceOf()
          Returns the area definition the new area is to be made an instance of.
 ParameterCtx getPartOf()
          Returns the area the new area is to be made a part/sub area of.
 ParameterCtx getWhen()
          Returns when the create area action is to take place (start or end).
 void removeBoundVariable(VariableCtx var)
          Removes the specified variable as a variable bound by this activity.
 void removeInhabitant(ParameterCtx inhabitant)
          Removes the specified inhabitant (ParameterCtx) from the list of inhabitants for the new area.
 void setDestination(ParameterCtx destination)
          Sets the create area's destination variable.
 void setDestinationName(ParameterCtx destinationName)
          Sets the name for the created area.
 void setInstanceOf(ParameterCtx instanceOf)
          Sets the area definition the new area is to be made an instance of.
 void setPartOf(ParameterCtx partOf)
          Returns the area the new area is to be made a part/sub area of.
 void setWhen(ParameterCtx when)
          Sets when the create area action is to take place (start or end).
 
Methods inherited from class gov.nasa.arc.brahms.common.rt.PrimitiveActivityCtx
addResource, getDuration, getElapsedTime, getMaxDuration, getMinDuration, getRandom, getResourceCount, getResources, removeResource, setDuration, setElapsedTime, setMaxDuration, setMinDuration, setRandom
 
Methods inherited from class gov.nasa.arc.brahms.common.rt.ActivityCtx
getCompletionCause, getDisplayText, getParentFrame, getPerformedBy, getPriority, 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.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

CreateAreaActivityCtx

public CreateAreaActivityCtx(CreateAreaActivity act)
Constructor, creates a new context for the specified CreateAreaActivity.

Parameters:
act - the CreateAgentActivity for which to create a context
Method Detail

setInstanceOf

public void setInstanceOf(ParameterCtx instanceOf)
                   throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the area definition the new area is to be made an instance of. The area definition is set through a parameter context containing either the actual value (AreaDef) or a reference to a variable containing the area definition.

Parameters:
instanceOf - the area definition
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if the specified instance of value is null

getInstanceOf

public ParameterCtx getInstanceOf()
                           throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the area definition the new area is to be made an instance of. The area definition is set through a parameter context containing either the actual value (AreaDef) or a reference to a variable containing the area definition.

Specified by:
getInstanceOf in interface ICreateAreaActivityCtx
Returns:
ParameterCtx the area definition
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if the instance of value is not defined

setPartOf

public void setPartOf(ParameterCtx partOf)
               throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the area the new area is to be made a part/sub area of. The area is set through a parameter context containing either the actual value (Area) or a reference to a variable containing the area.

Parameters:
partOf - the area
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if the part of value is null

getPartOf

public ParameterCtx getPartOf()
                       throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the area the new area is to be made a part/sub area of. The area is set through a parameter context containing either the actual value (Area) or a reference to a variable containing the area.

Specified by:
getPartOf in interface ICreateAreaActivityCtx
Returns:
ParameterCtx the area
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if the part of value is not defined

addInhabitant

public void addInhabitant(ParameterCtx inhabitant)
                   throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Adds the specified inhabitant (ParameterCtx) as a concept to be added as an inhabitant of the newly created area. The inhabitant is specified through a parameter context containing either the actual value (Agent or ObjectInstance) or a reference to a variable containing the value.

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

removeInhabitant

public void removeInhabitant(ParameterCtx inhabitant)
                      throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Removes the specified inhabitant (ParameterCtx) from the list of inhabitants for the new area. The inhabitant is specified through a parameter context containing either the actual value (Agent or ObjectInstance) or a reference to a variable containing the value.

Parameters:
inhabitant - the inhabitant to be removed
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if inhabitant is null, no inhabitants are available, or the inhabitant is not found

getInhabitants

public java.util.Enumeration getInhabitants()
                                     throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns a list of the agents or objects that have to be added as inhabitants to the new area. Each agent and object is specified through a parameter context containing either the actual value (Agent or ObjectInstance) or a reference to a variable containing the value.

Specified by:
getInhabitants in interface ICreateAreaActivityCtx
Returns:
Enumeration an enumeration of ParameterCtx referencing Agents or ObjectInstances
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if there are no inhabitants

setWhen

public void setWhen(ParameterCtx when)
             throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets when the create area action is to take place (start or end). The when value is set through a parameter context containing either the actual value (int) or a reference to a variable containing the when value.

Parameters:
when - the ParameterCtx defining the when the create area action is to occur
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if a null when value is defined

getWhen

public ParameterCtx getWhen()
                     throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns when the create area action is to take place (start or end). The when value is set through a parameter context containing either the actual value (int) or a reference to a variable containing the when value.

Specified by:
getWhen in interface ICreateAreaActivityCtx
Returns:
ParameterCtx the when value defining when the create area action is to occur
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if the when value is not defined

setDestination

public void setDestination(ParameterCtx destination)
                    throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the create area's destination variable. The destination is specified through a parameter context containing either a reference to a variable containing the value.

Parameters:
destination - the ParameterCtx containing the destination
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if a null destination is specified

getDestination

public ParameterCtx getDestination()
                            throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the create area's destination variable. The destination is specified through a parameter context containing a reference to a variable containing the value.

Specified by:
getDestination in interface ICreateAreaActivityCtx
Returns:
ParameterCtx the destination
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no destination is specified

setDestinationName

public void setDestinationName(ParameterCtx destinationName)
                        throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the name for the created area. The destination name is specified through a parameter context containing either the actual value (String) or a reference to a variable containing the value.

Parameters:
destinationName - the ParameterCtx containing the destination name
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if a null destination name is specified

getDestinationName

public ParameterCtx getDestinationName()
                                throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the name for the created area. The destination name is specified through a parameter context containing either the actual value (String) or a reference to a variable containing the value.

Specified by:
getDestinationName in interface ICreateAreaActivityCtx
Returns:
ParameterCtx the destination name
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no destination name is specified

addBoundVariable

public void addBoundVariable(VariableCtx var)
                      throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Adds the specified variable as a variable bound by this activity.

Specified by:
addBoundVariable in interface ICreateAreaActivityCtx
Parameters:
var - the variable (VariableCtx) to be added
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if var is null

removeBoundVariable

public void removeBoundVariable(VariableCtx var)
                         throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Removes the specified variable as a variable bound by this activity.

Specified by:
removeBoundVariable in interface ICreateAreaActivityCtx
Parameters:
var - the variable (VariableCtx) to be removed
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if variable is null, no variables are present, or the variable is not found

getBoundVariables

public java.util.Enumeration getBoundVariables()
                                        throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns a list of all the variables used by this activity.

Specified by:
getBoundVariables in interface ICreateAreaActivityCtx
Returns:
Enumeration an enumeration of VariableCtx
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if there are no variables


Copyright © 1997-2012 All Rights Reserved.