|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gov.nasa.arc.brahms.common.data.BrahmsObject gov.nasa.arc.brahms.common.data.ModelElement gov.nasa.arc.brahms.common.data.NamedModelElement gov.nasa.arc.brahms.common.data.Activity gov.nasa.arc.brahms.common.data.PrimitiveActivity gov.nasa.arc.brahms.common.data.MoveActivity
public class MoveActivity
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.
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 |
---|
public MoveActivity()
public MoveActivity(java.lang.String name)
name
- the name of the move activitypublic MoveActivity(java.lang.String file, int line)
file
- the file in which the move activity is specifiedline
- the line number at which the specification starts in the filepublic MoveActivity(java.lang.String name, java.lang.String file, int line)
name
- the name of the move activityfile
- the file in which the move activity is specifiedline
- the line number at which the specification starts in the fileMethod Detail |
---|
protected void setID()
setID
in class PrimitiveActivity
public void setLocation(Parameter p)
public void setLocation(Area area)
public NamedModelElement getLocation()
public boolean addDetectDepartureInArea(Parameter p)
p
- the parameter referencing the area
public boolean addDetectDepartureInArea(Area obj)
obj
- the to-Area
public boolean hasDetectDepartureInAreas()
public java.util.Enumeration getDetectDepartureInAreas()
public void setDetectDepartureInSubAreas(Parameter p)
p
- the parameter specifying the boolean value.public void setDetectDepartureInSubAreas(java.lang.Boolean b)
b
- the Boolean value.public java.lang.Object getDetectDepartureInSubAreas()
setDetectDepartureInSubAreas(gov.nasa.arc.brahms.common.data.Parameter)
public boolean addDetectArrivalInArea(Parameter p)
p
- the parameter referencing the area
public boolean addDetectArrivalInArea(Area obj)
obj
- the Area
public boolean hasDetectArrivalInAreas()
public java.util.Enumeration getDetectArrivalInAreas()
public void setDetectArrivalInSubAreas(Parameter p)
p
- the parameter specifying the boolean value.public void setDetectArrivalInSubAreas(java.lang.Boolean b)
b
- the Boolean value.public java.lang.Object getDetectArrivalInSubAreas()
setDetectDepartureInSubAreas(gov.nasa.arc.brahms.common.data.Parameter)
public IActivityCtx createContext()
Note: This method always returns a new instance and does not verify whether one is already created.
createContext
in class PrimitiveActivity
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |