gov.nasa.arc.brahms.common.data
Class MoveActivity

java.lang.Object
  extended by gov.nasa.arc.brahms.common.data.BrahmsObject
      extended by gov.nasa.arc.brahms.common.data.ModelElement
          extended by gov.nasa.arc.brahms.common.data.NamedModelElement
              extended by gov.nasa.arc.brahms.common.data.Activity
                  extended by gov.nasa.arc.brahms.common.data.PrimitiveActivity
                      extended by gov.nasa.arc.brahms.common.data.MoveActivity
All Implemented Interfaces:
gov.nasa.arc.brahms.common.IConstants, java.io.Serializable
Direct Known Subclasses:
VMMoveActivity

public class MoveActivity
extends PrimitiveActivity

A move activity is a primitive activity but is used to move an agent from its current location to the location as specified in the activity. The move activity first checks whether the duration is specified for the move activity. If the specified duration is larger than 0 it will use that duration for the move. If no duration is specified or the specified duration is 0 then the simulation engine tries to determine its duration by calculating the time it takes to move from the current location to the goal location using the shortest path specified between the two location. If no paths are specified between the locations then the duration of the move activity will be 0. When the move activity is started the agent or object being moved will be location-less. All of the facts and beliefs about the location of the agent will be retracted as well as the location facts and beliefs of the agents or objects contained by the agent or object. By default all agents in the same location as the start location of the move will detect that the agent/object is leaving and will retract the beliefs about the location of those agents and objects. It is possible to specify explicitly in which areas agents will detect the moving agent leaving the location by specifying a list of areas in the detectDepartureIn property for the move activity. By default all agents in the specified areas and their sub areas will detect the agent leaving and will therefore retract the location beliefs about that agent and the agents/objects being carried. If the detectDepartureInSubAreas is false then only agents in the specified areas will detect the departure, not the agents in the sub areas of the specified areas. When the activity is interrupted or impassed the agent or object will still remain location-less. It is possible that while the activity is interrupted the agent or object was moved to another location. If the agent or object moves while the activity was interrupted the duration of the interrupted activity will be recalculated as if the move starts all over again. If the agent or object did not move while interrupted then the activity will resume where it left of, the duration will not be recalculated, the activity will be active for the remaining duration. On arrival in the goal location a fact and belief will be asserted for the traveling agent or object about its new location. For all contained agents/ objects a fact is asserted about their new location, the contained agents will also get a belief about their new location. By default the agents in the goal location will detect the traveling agent as well as any contained agents. The traveling agent and contained agent(s) will detect all the agents and objects in the goal location. For any of the contained objects the traveling agent will get a belief of the object if the agent already knew about the location of the contained object before it started the move. The model builder can control who detects the arrival by specifying a list of areas in the detectArrivalIn property for the activity. Only the agents located in the specified list of areas and their sub-areas will detect the arrival of the agent and its contained agents. If the detectArrivalInSubAreas property is set to false then the agents located in the sub areas of the specified areas will not detect the arrival of the agent and its contained agents.

Version:
$Revision: 1.2 $ $Date: 2009/11/23 19:06:41 $ $Author: rnado $
Author:
Ron van Hoof
See Also:
Serialized Form

Field Summary
 
Fields inherited from class gov.nasa.arc.brahms.common.data.NamedModelElement
NAME_PROPERTY
 
Fields inherited from interface gov.nasa.arc.brahms.common.IConstants
ABORT, ACTIVECLASS, ACTIVECONCEPT, ACTIVEINSTANCE, AGENT, ANONYMOUS, ANYAGENT, AREA, AREADEF, ASSIGNED, ATTRIBUTE, BASEAREADEF, BASECLASS, BASECONCEPTUALCLASS, BASEGROUP, BASELIBRARY, BOOLEAN, BROADCAST, BUILDING, BYTE, CCLOCK, CDATE, CHAR, CITY, CLASS, CLOCK, COLLECTALL, COMMUNICATE, COMPLETE, COMPOSITE, COMPUTER, CONCEPT, CONCEPTUALCLASS, CONCEPTUALCONCEPT, CONCEPTUALOBJECT, CONTINUE, COPY, CREATEAGENT, CREATEAREA, CREATEOBJECT, current, CURRENT, DATAFRAME, DATE, DB, DETECTABLE, DIV, DOUBLE, EMAIL, EMPTY_STRING, END, ENDACTIVITY, ENTAGENT, EQ, EXCEPTION, EXPR, FACE2FACE, FACTFRAME, FALSE, FAX, FLOAT, FOREACH, FORONE, G2, GE, GEOGRAPHYCONCEPT, GESTURE, GET, GROUP, GT, IMPASSE, INT, INVALID, JAVA, JAVA_TYPE, KNOWN_MODIFIER, KNOWNVAL_MODIFIER, LE, LOCAL, LONG, LT, MAP, MINUS, MOD, MOVE, MULT, NE, NEW, NONE, NOT_MODIFIER, NOWORK, O, OA, OBJECT, ONTOLOGY, PAGER, PARAMETER, PATH, PHONE, PLUS, PRIMITIVE, PRIVATE, PROAGENT, PROTECTED, PRSAGENT, PUBLIC, PUT, RECEIVE, RELATION, sACTIVECLASS, sACTIVECONCEPT, sACTIVEINSTANCE, sAGENT, sARCHIVE, sAREA, sAREADEF, sBOOLEAN, sBYTE, sBYTECODEEXT, sCHAR, sCLASS, sCOMPUTER, sCONCEPT, sCONCEPTUALCLASS, sCONCEPTUALCONCEPT, sCONCEPTUALOBJECT, sCOPY, sCURRENT, sDETECTABLE, sDOUBLE, sEMAIL, sEND, SEND, sFACE2FACE, sFAX, sFILEEXT, sFLOAT, sGEOGRAPHYCONCEPT, sGROUP, SHORT, SIMAGENT, sINT, sJAVA_TYPE, sLONG, sMAP, sNEW, sNONE, sNOWORK, sOBJECT, SOURCECODE, sPAGER, sPARAMETER, sPATH, sPHONE, sPRIVATE, sPROJECTEXT, sPROTECTED, sPUBLIC, sSHORT, sSTART, sSTRING, sSYMBOL, START, STRING, sUNKNOWN, sVOID, SYMBOL, TRUE, UDT, UML, UNASSIGNED, UNDEFINED, unknown, UNKNOWN, UNKNOWN_MODIFIER, V, VARIABLE, VOID, WHENEVER, WORKFRAME, WORLD, XML
 
Constructor Summary
MoveActivity()
          Constructor, creates a new move activity.
MoveActivity(java.lang.String name)
          Constructor, creates a new move activity with the specified name.
MoveActivity(java.lang.String file, int line)
          Constructor, creates a new move activity that is specified in the specified file at the specified line number.
MoveActivity(java.lang.String name, java.lang.String file, int line)
          Constructor, creates a new move activity with the specified name that is specified in the specified file at the specified line number.
 
Method Summary
 boolean addDetectArrivalInArea(Area obj)
          Adds a new area to the list of areas where arrival should be detected in.
 boolean addDetectArrivalInArea(Parameter p)
          Adds a new area to the list of areas where arrival should be detected in.
 boolean addDetectDepartureInArea(Area obj)
          Adds a new area to the list of areas where departure should be detected in.
 boolean addDetectDepartureInArea(Parameter p)
          Adds a new area to the list of areas where departure should be detected in.
 IActivityCtx createContext()
          Creates a new context for this activity for use in a virtual machine.
 java.util.Enumeration getDetectArrivalInAreas()
          Returns all the areas in which arrival should be detected in as specified in the activity.
 java.lang.Object getDetectArrivalInSubAreas()
          Indicates whether the move should allow for arrival detection not only in the areas listed by the 'detectArrivalIn' property but also in its sub areas.
 java.util.Enumeration getDetectDepartureInAreas()
          Returns all the areas in which departure should be detected in as specified in the activity.
 java.lang.Object getDetectDepartureInSubAreas()
          Indicates whether the move should allow for departure detection not only in the areas listed by the 'detectDepartureIn' property but also in its sub areas.
 NamedModelElement getLocation()
           
 boolean hasDetectArrivalInAreas()
          Returns whether the activity specifies areas in which arrival should be detected in.
 boolean hasDetectDepartureInAreas()
          Returns whether the activity specifies areas in which departure should be detected in.
 void setDetectArrivalInSubAreas(java.lang.Boolean b)
          Sets the indicator whether the move should allow for arrival detection not only in the areas listed by the 'detectArrivalIn' property but also in its sub areas.
 void setDetectArrivalInSubAreas(Parameter p)
          Sets the indicator whether the move shoudl allow for arrival detection not only in the areas listed by the 'detectArrivalIn' property but also in its sub areas.
 void setDetectDepartureInSubAreas(java.lang.Boolean b)
          Sets the indicator whether the move should allow for departure detection not only in the areas listed by the 'detectDepartureIn' property but also in its sub areas.
 void setDetectDepartureInSubAreas(Parameter p)
          Sets the indicator whether the move shoudl allow for departure detection not only in the areas listed by the 'detectDepartureIn' property but also in its sub areas.
protected  void setID()
          Sets the unique identifier.
 void setLocation(Area area)
           
 void setLocation(Parameter p)
           
 
Methods inherited from class gov.nasa.arc.brahms.common.data.PrimitiveActivity
addResource, addResource, addTouchedObject, addTouchedObject, getMaxDuration, getMinDuration, getRandom, getResources, getTouchedObjects, hasResources, hasTouchedObjects, setMaxDuration, setMaxDuration, setMinDuration, setMinDuration, setRandom, setRandom
 
Methods inherited from class gov.nasa.arc.brahms.common.data.Activity
addParameter, addReference, convertWhenSymbolToInt, delete, getActivityDescriptor, getDisplayText, getFullyQualifiedName, getParameter, getParameter, getParameterCount, getParameters, getPriority, getQualifiedName, getReferences, hasParameters, removeParameter, removeReference, setActivityDescriptor, setDisplayText, setDisplayText, setOwner, setOwner, setPriority, setPriority
 
Methods inherited from class gov.nasa.arc.brahms.common.data.NamedModelElement
getName, getOwner, setFullyQualifiedName, setName, setOwner, toString
 
Methods inherited from class gov.nasa.arc.brahms.common.data.BrahmsObject
export, getFile, getID, getLine, getSerialNumber, isBCC, isDynamic, isLoaded, isResolved, setBCC, setDynamic, setFile, setID, setLine, setLoaded, setResolved, setSerialNumber
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MoveActivity

public MoveActivity()
Constructor, creates a new move activity.


MoveActivity

public MoveActivity(java.lang.String name)
Constructor, creates a new move activity with the specified name.

Parameters:
name - the name of the move activity

MoveActivity

public MoveActivity(java.lang.String file,
                    int line)
Constructor, creates a new move activity that is specified in the specified file at the specified line number.

Parameters:
file - the file in which the move activity is specified
line - the line number at which the specification starts in the file

MoveActivity

public MoveActivity(java.lang.String name,
                    java.lang.String file,
                    int line)
Constructor, creates a new move activity with the specified name that is specified in the specified file at the specified line number.

Parameters:
name - the name of the move activity
file - the file in which the move activity is specified
line - the line number at which the specification starts in the file
Method Detail

setID

protected void setID()
Sets the unique identifier.

Overrides:
setID in class PrimitiveActivity

setLocation

public void setLocation(Parameter p)

setLocation

public void setLocation(Area area)

getLocation

public NamedModelElement getLocation()

addDetectDepartureInArea

public boolean addDetectDepartureInArea(Parameter p)
Adds a new area to the list of areas where departure should be detected in. The area is referenced by the specified parameter.

Parameters:
p - the parameter referencing the area
Returns:
boolean true if added, false otherwise

addDetectDepartureInArea

public boolean addDetectDepartureInArea(Area obj)
Adds a new area to the list of areas where departure should be detected in.

Parameters:
obj - the to-Area
Returns:
boolean true if added, false otherwise

hasDetectDepartureInAreas

public boolean hasDetectDepartureInAreas()
Returns whether the activity specifies areas in which departure should be detected in.

Returns:
boolean true if the activity specifies departure detection areas, false otherwise

getDetectDepartureInAreas

public java.util.Enumeration getDetectDepartureInAreas()
Returns all the areas in which departure should be detected in as specified in the activity.

Returns:
Enumeration a list of the areas, Parameters and/or Areas

setDetectDepartureInSubAreas

public void setDetectDepartureInSubAreas(Parameter p)
Sets the indicator whether the move shoudl allow for departure detection not only in the areas listed by the 'detectDepartureIn' property but also in its sub areas.

Parameters:
p - the parameter specifying the boolean value.

setDetectDepartureInSubAreas

public void setDetectDepartureInSubAreas(java.lang.Boolean b)
Sets the indicator whether the move should allow for departure detection not only in the areas listed by the 'detectDepartureIn' property but also in its sub areas.

Parameters:
b - the Boolean value.

getDetectDepartureInSubAreas

public java.lang.Object getDetectDepartureInSubAreas()
Indicates whether the move should allow for departure detection not only in the areas listed by the 'detectDepartureIn' property but also in its sub areas.

Returns:
Object a Boolean or Parameter
See Also:
setDetectDepartureInSubAreas(gov.nasa.arc.brahms.common.data.Parameter)

addDetectArrivalInArea

public boolean addDetectArrivalInArea(Parameter p)
Adds a new area to the list of areas where arrival should be detected in. The area is referenced by the specified parameter.

Parameters:
p - the parameter referencing the area
Returns:
boolean true if added, false otherwise

addDetectArrivalInArea

public boolean addDetectArrivalInArea(Area obj)
Adds a new area to the list of areas where arrival should be detected in.

Parameters:
obj - the Area
Returns:
boolean true if added, false otherwise

hasDetectArrivalInAreas

public boolean hasDetectArrivalInAreas()
Returns whether the activity specifies areas in which arrival should be detected in.

Returns:
boolean true if the activity specifies arrival detection areas, false otherwise

getDetectArrivalInAreas

public java.util.Enumeration getDetectArrivalInAreas()
Returns all the areas in which arrival should be detected in as specified in the activity.

Returns:
Enumeration a list of the areas, Parameters and/or Areas

setDetectArrivalInSubAreas

public void setDetectArrivalInSubAreas(Parameter p)
Sets the indicator whether the move shoudl allow for arrival detection not only in the areas listed by the 'detectArrivalIn' property but also in its sub areas.

Parameters:
p - the parameter specifying the boolean value.

setDetectArrivalInSubAreas

public void setDetectArrivalInSubAreas(java.lang.Boolean b)
Sets the indicator whether the move should allow for arrival detection not only in the areas listed by the 'detectArrivalIn' property but also in its sub areas.

Parameters:
b - the Boolean value.

getDetectArrivalInSubAreas

public java.lang.Object getDetectArrivalInSubAreas()
Indicates whether the move should allow for arrival detection not only in the areas listed by the 'detectArrivalIn' property but also in its sub areas.

Returns:
Object a Boolean or Parameter
See Also:
setDetectDepartureInSubAreas(gov.nasa.arc.brahms.common.data.Parameter)

createContext

public IActivityCtx createContext()
Creates a new context for this activity for use in a virtual machine.

Note: This method always returns a new instance and does not verify whether one is already created.

Overrides:
createContext in class PrimitiveActivity
Returns:
IActivityCtx the activity's context


Copyright © 1997-2012 All Rights Reserved.