|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgov.nasa.arc.brahms.common.rt.BrahmsObjectCtx
gov.nasa.arc.brahms.common.rt.FrameCtx
public class FrameCtx
The FrameCtx maintains the general state information for a Brahms frame, workframe or thoughtframe. The frame context maintains the status of the frame, the state of the frame, the executing active instance, and the contexts of the variables in the frame, preconditions that evaluated to true making the frame available and consequences fired in the frame. A modeled Brahms frame can have multiple contexts due to the possible different bindings of its variables.
| 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 | |
|---|---|
FrameCtx(BFrame frame)
Constructor, creates a new context for the specified frame. |
|
FrameCtx(BFrame frame,
IActiveInstanceCtx agent)
Constructor, creates a new context for the specified frame setting the specified agent as the agent working on frame. |
|
| Method Summary | |
|---|---|
void |
addBinding(VariableCtx var)
Adds the specified variable binding to this frame context. |
void |
addFiredConsequence(ConsequenceCtx consequence)
Adds the specified consequence as a fired consequence to the list of fired consequences. |
VariableCtx |
getBinding(Variable var)
Returns the binding for the specified variable. |
java.util.Enumeration |
getBindings()
Returns the frame context's variable bindings. |
java.util.ListIterator |
getFiredConsequences()
Returns the list of fired consequences. |
IActiveInstanceCtx |
getPerformedBy()
Returns the active instance executing the frame. |
ICompositeActivityCtx |
getPerformedIn()
If the frame is performed as part of a composite activity this method returns the context of the composite activity in which the frame is performed. |
int |
getPriority()
Returns the priority of the frame context. |
FrameStateCtx |
getState()
Returns the current state of the frame context. |
int |
getStatus()
Returns the frame's current status. |
long |
getTimeAvailable()
Returns the time the frame became available to work on. |
void |
removeBinding(VariableCtx var)
Removes the specified variable binding from this frame context. |
void |
removeFiredConsequence(ConsequenceCtx consequence)
Removes the specified consequence as a fired consequence from the list of fired consequences. |
void |
setPerformedBy(IActiveInstanceCtx ai)
Sets the active instance executing the frame. |
void |
setPerformedIn(ICompositeActivityCtx act)
If the frame is performed as part of a composite activity this method sets the context of the composite activity in which the frame is performed. |
void |
setPriority(int priority)
Sets the priority of the frame context. |
void |
setState(FrameStateCtx state)
Sets the current state of the frame context. |
void |
setState(FrameStateCtx state,
boolean maintainHistory)
Sets the current state of the frame context. |
void |
setStatus(int status)
Sets the frame's current status. |
void |
setTimeAvailable(long time)
Sets the time the frame became available to work on. |
java.lang.String |
toString()
Returns the fully qualified name of the frame this is a context for. |
| 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 FrameCtx(BFrame frame)
frame - the BFrame for which this frame context is a context
public FrameCtx(BFrame frame,
IActiveInstanceCtx agent)
frame - the BFrame for which this frame context is a contextagent - the agent working on the frame| Method Detail |
|---|
public void setPriority(int priority)
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
setPriority in interface IFrameCtxpriority - the frame context's priority
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an invalid priority is specified (< 0)
public int getPriority()
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
getPriority in interface IFrameCtxgov.nasa.arc.brahms.common.exceptions.BrahmsException - if no priority is set
public void setPerformedBy(IActiveInstanceCtx ai)
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
setPerformedBy in interface IFrameCtxai - the active instance executing the frame.
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if a null active instance is specified
public IActiveInstanceCtx getPerformedBy()
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
getPerformedBy in interface IFrameCtxgov.nasa.arc.brahms.common.exceptions.BrahmsException - if no active instance is specified
public void setPerformedIn(ICompositeActivityCtx act)
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
setPerformedIn in interface IFrameCtxact - the ICompositeActivityCtx of the composite activity in
which the frame is performed.
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if a null composite activity is specified.
public ICompositeActivityCtx getPerformedIn()
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
getPerformedIn in interface IFrameCtxgov.nasa.arc.brahms.common.exceptions.BrahmsException - if an internal error occurs.
public void setStatus(int status)
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
setStatus in interface IFrameCtxstatus - the status of the frame context
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if status is an invalid statusIRuntimeConstants.UNAVAILABLE,
IRuntimeConstants.AVAILABLE,
IRuntimeConstants.ACTIVE,
IRuntimeConstants.INTERRUPTED,
IRuntimeConstants.IMPASSED,
IRuntimeConstants.ABORTED,
IRuntimeConstants.COMPLETED,
IRuntimeConstants.ENDED
public int getStatus()
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
getStatus in interface IFrameCtxgov.nasa.arc.brahms.common.exceptions.BrahmsException - if frame context has no status or invalid statusIRuntimeConstants.UNAVAILABLE,
IRuntimeConstants.AVAILABLE,
IRuntimeConstants.ACTIVE,
IRuntimeConstants.INTERRUPTED,
IRuntimeConstants.IMPASSED,
IRuntimeConstants.ABORTED,
IRuntimeConstants.COMPLETED,
IRuntimeConstants.ENDEDpublic void setState(FrameStateCtx state)
setState in interface IFrameCtxstate - the FrameStateCtx with the state informationActiveCtx,
AvailableCtx,
UnavailableCtx,
InterruptCtx,
ImpasseCtx,
CompleteCtx
public void setState(FrameStateCtx state,
boolean maintainHistory)
setState in interface IFrameCtxstate - the FrameStateCtx with the state informationmaintainHistory - true if history must be maintained, false otherwiseActiveCtx,
AvailableCtx,
UnavailableCtx,
InterruptCtx,
ImpasseCtx,
CompleteCtxpublic FrameStateCtx getState()
getState in interface IFrameCtxActiveCtx,
AvailableCtx,
UnavailableCtx,
InterruptCtx,
ImpasseCtx,
CompleteCtxpublic void setTimeAvailable(long time)
setTimeAvailable in interface IFrameCtxtime - the time the frame became available in simulation unitspublic long getTimeAvailable()
getTimeAvailable in interface IFrameCtx
public void addBinding(VariableCtx var)
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
addBinding in interface IFrameCtxvar - the VariableCtx to be added
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if the specified variable is null.
public void removeBinding(VariableCtx var)
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
removeBinding in interface IFrameCtxvar - the VariableCtx to be removed
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if a null variable is specified, no
bindings are present or the specified variable is
not present
public VariableCtx getBinding(Variable var)
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
getBinding in interface IFrameCtxvar - the variable for which the binding is requested
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no binding for the specified variable exists
public java.util.Enumeration getBindings()
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
getBindings in interface IFrameCtxgov.nasa.arc.brahms.common.exceptions.BrahmsException - if frame context has no bindings
public void addFiredConsequence(ConsequenceCtx consequence)
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
addFiredConsequence in interface IFrameCtxconsequence - the ConsequenceCtx for the consequence fired in the frame
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if the consequence is null
public void removeFiredConsequence(ConsequenceCtx consequence)
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
removeFiredConsequence in interface IFrameCtxconsequence - the ConsequenceCtx for the consequence fired in the frame
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if the consequence is null or no fired consequences exist
or the specified consequence is not found
public java.util.ListIterator getFiredConsequences()
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
getFiredConsequences in interface IFrameCtxgov.nasa.arc.brahms.common.exceptions.BrahmsException - if no fired consequences existpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||