|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gov.nasa.arc.brahms.common.rt.BrahmsObjectCtx gov.nasa.arc.brahms.common.rt.ConceptCtx gov.nasa.arc.brahms.common.rt.AreaCtx gov.nasa.arc.brahms.vm.rt.VMAreaCtx
public class VMAreaCtx
The VMAreaCtx is the runtime representation of areas defined in a Brahms model with extensions for use in the virtual machine. The area context manages the creation and deletion time of the areas. Area contexts are also used to trace the traveled path of an active instance. In the case an area context is used to define a traveled path the start and end time represent the time the active instance arrived in the area and when the active instance left the area. The area context also manages a list of the active instances present in the location.
AreaCtx
,
Serialized FormField 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 | |
---|---|
VMAreaCtx(Area area)
Constructor, creates a new context for the specified area. |
Method Summary | |
---|---|
void |
addInhabitant(VMActiveInstanceCtx inhabitant,
long time,
int sourceType,
BrahmsObjectCtx source)
Adds the specified active instance to this location as an inhabitant. |
protected java.util.Enumeration |
getInhabitantsDetectingArrival(BrahmsObjectCtx source)
Returns a list of all the inhabitants that can detect the arrival of an agent or object. |
protected java.util.Enumeration |
getInhabitantsDetectingDeparture(BrahmsObjectCtx source)
Returns a list of all the inhabitants that can detect the departure of an agent or object. |
protected int |
getNodeIndex()
Returns the node index used in Dijkstra's shortest path algorithm to determine the shortest duration from one area to another. |
void |
initialize(gov.nasa.arc.brahms.vm.controller.VMController vmc,
long time)
Initializes the concept for use in a virtual machine controller by the specified virtual machine controller. |
void |
removeInhabitant(VMActiveInstanceCtx inhabitant,
long time,
int sourceType,
BrahmsObjectCtx source)
Removes the specified active instance from this location as an inhabitant It retracts the location fact and beliefs for the inhabitant and makes sure that the agents in the location will detect the agent leaving by retracting the location beliefs for the inhabitant. |
void |
removeInhabitant(VMActiveInstanceCtx inhabitant,
long time,
int sourceType,
BrahmsObjectCtx source,
java.util.LinkedList llCheckedInstances)
Removes the specified active instance from this location as an inhabitant It retracts the location fact and beliefs for the inhabitant and makes sure that the agents in the location will detect the agent leaving by retracting the location beliefs for the inhabitant. |
void |
reset()
Resets the area context, removing all inhabitants. |
protected void |
setNodeIndex(int index)
Sets the node index used in Dijkstra's shortest path algorithm to determine the shortest duration from one area to another. |
Methods inherited from class gov.nasa.arc.brahms.common.rt.AreaCtx |
---|
addInhabitant, getInhabitants, isInhabitant, removeAllInhabitants, removeInhabitant |
Methods inherited from class gov.nasa.arc.brahms.common.rt.ConceptCtx |
---|
addAttribute, addRelation, getAttribute, getRelation, initAttributeRelationCache, removeAttribute, removeRelation, resetAttributeRelationCache, 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.IBrahmsObjectCtx |
---|
addNote, getContextFor, getEndTime, getID, getNote, getNotes, getStartTime, removeNote, setEndTime, setID, setStartTime |
Constructor Detail |
---|
public VMAreaCtx(Area area)
area
- the Area for which to create a contextMethod Detail |
---|
protected final void setNodeIndex(int index)
index
- the unique node indexprotected final int getNodeIndex()
public void initialize(gov.nasa.arc.brahms.vm.controller.VMController vmc, long time) throws VMException
initialize
in interface IRuntimeConceptCtx
vmc
- the VMController controlling the virtual machine in which this
concept is to be used.time
- the time at which the initialization is performed
VMException
- if an error occurs in initializing the conceptpublic void reset() throws VMException
reset
in interface IRuntimeConceptCtx
VMException
- if in error occurs in resetting the conceptprotected java.util.Enumeration getInhabitantsDetectingArrival(BrahmsObjectCtx source) throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
source
- the source that caused the inhabitant to be added
gov.nasa.arc.brahms.common.exceptions.BrahmsException
protected java.util.Enumeration getInhabitantsDetectingDeparture(BrahmsObjectCtx source) throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
source
- the source that caused the inhabitant to be added
gov.nasa.arc.brahms.common.exceptions.BrahmsException
public void addInhabitant(VMActiveInstanceCtx inhabitant, long time, int sourceType, BrahmsObjectCtx source) throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
inhabitant
- the active instance to be addedtime
- the time at which the inhabitant is addedsourceType
- the type of the sourcesource
- the source that caused the inhabitant to be added
gov.nasa.arc.brahms.common.exceptions.BrahmsException
- if a null inhabitant is specifiedpublic void removeInhabitant(VMActiveInstanceCtx inhabitant, long time, int sourceType, BrahmsObjectCtx source) throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
inhabitant
- the active instance to be removedtime
- the time at which the inhabitant is removedsourceType
- the type of the sourcesource
- the source that caused the inhabitant to be removed
gov.nasa.arc.brahms.common.exceptions.BrahmsException
- if a null inhabitant is specified, if no inhabitants
are present in the location or if the inhabitant is not foundpublic void removeInhabitant(VMActiveInstanceCtx inhabitant, long time, int sourceType, BrahmsObjectCtx source, java.util.LinkedList llCheckedInstances) throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
inhabitant
- the active instance to be removedtime
- the time at which the inhabitant is removedsourceType
- the type of the sourcesource
- the source that caused the inhabitant to be removedllCheckedInstances
- the instances that were already removed from the location as a contained instance
gov.nasa.arc.brahms.common.exceptions.BrahmsException
- if a null inhabitant is specified, if no inhabitants
are present in the location or if the inhabitant is not found
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |