|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ix.icore.process.TimePoint ix.icore.process.PNode
public abstract class PNode
A node that represents an action or acticity in a process. This class supports expansion into subactions and the propagation of status changes, thus acting as a simple process model / simulator and expansion planner.
Nested Class Summary | |
---|---|
protected class |
PNode.MakeVarIfUnbound
|
Field Summary | |
---|---|
protected PNodeEnd |
beginEnd
|
protected PNodeEnd |
endEnd
|
protected int |
level
|
protected ProcessModelManager |
modelManager
|
protected PNode |
parent
|
Fields inherited from class ix.icore.process.TimePoint |
---|
tpn_mark |
Constructor Summary | |
---|---|
PNode(PNode parent)
|
Method Summary | |
---|---|
void |
addChild(PNode child,
PNode after)
|
static void |
allComputeStatus(java.util.List l)
|
static boolean |
allHaveStatus(java.util.List l,
Status status)
|
void |
assignStatus(Status status)
Called when loading a plan to give this PNode the status specified in the plan. |
void |
computeStatus()
computeStatus() is used to change the status of related nodes when a node changes its status. |
void |
ensureChildrenLinkedToParent()
Ensures that all children of this PNode are linked, directly or indirectly, between its ends. |
void |
expandOneLevel(Refinement sourceRefinement,
MatchEnv env)
Creates child nodes as specified by a refinement and installs ordering links. |
PNodeEnd |
getBegin()
|
java.util.List<PNode> |
getChildren()
|
PNodeEnd |
getEnd()
|
PNodeEnd |
getEnd(End whichEnd)
|
int |
getLevel()
|
ProcessModelManager |
getModelManager()
|
java.util.Map<Name,PNode> |
getNameToChildMap()
|
PNode |
getParentPNode()
|
abstract LList |
getPattern()
|
Refinement |
getRefinement()
|
abstract Status |
getStatus()
|
java.util.Map |
getVarTable()
|
boolean |
hasChildren()
|
boolean |
isAncestorOf(PNode n)
|
boolean |
isDescendentOf(PNode n)
|
boolean |
isExpanded()
|
boolean |
isParentOf(PNode n)
|
boolean |
isSiblingOf(PNode n)
|
protected abstract PNode |
makePNode(PNode parent,
LList pattern)
Factory method that constructs a child PNode of the right class. |
void |
processOrderings(ix.icore.domain.ListOfOrdering orderings)
Adds the before-after links between node-ends specified by a list of Orderings taken from a Refinement. |
PNodeEnd |
refToTimePoint(NodeEndRef ref)
Returns the node-end that corresponds to the node-end-ref. |
void |
setChildren(java.util.List l)
|
void |
setModelManager(ProcessModelManager mm)
|
void |
setNameToChildMap(java.util.Map<Name,PNode> map)
|
void |
setRefinement(Refinement r)
|
void |
setStatus(Status status)
Changes the node's status and then that of related nodes. |
void |
setVarTable(java.util.Map vt)
|
Status |
statusFromNodeEnds()
Determines the status this PNode should have, based on the statuses of its node-ends. |
void |
unlink()
|
void |
walk(Proc1<PNode> p)
Starts a walk at this PNode. |
void |
walkChildren(Proc1<PNode> p)
Walk this PNode's children. |
Methods inherited from class ix.icore.process.TimePoint |
---|
addPostConstraint, addPreConstraint, clear, getMaxTime, getMinTime, getPostConstraints, getPreConstraints, hasUnboundedMax, removePostConstraint, removePreConstraint, setMaxTime, setMinTime |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ProcessModelManager modelManager
protected int level
protected PNode parent
protected PNodeEnd beginEnd
protected PNodeEnd endEnd
Constructor Detail |
---|
public PNode(PNode parent)
Method Detail |
---|
public abstract LList getPattern()
public int getLevel()
public PNodeEnd getBegin()
public PNodeEnd getEnd()
public PNodeEnd getEnd(End whichEnd)
public PNode getParentPNode()
public java.util.List<PNode> getChildren()
public boolean hasChildren()
public void setChildren(java.util.List l)
public java.util.Map<Name,PNode> getNameToChildMap()
public void setNameToChildMap(java.util.Map<Name,PNode> map)
public ProcessModelManager getModelManager()
public void setModelManager(ProcessModelManager mm)
public java.util.Map getVarTable()
public void setVarTable(java.util.Map vt)
public Refinement getRefinement()
public void setRefinement(Refinement r)
public abstract Status getStatus()
getStatus
in interface HasStatus
public boolean isSiblingOf(PNode n)
public boolean isParentOf(PNode n)
public boolean isAncestorOf(PNode n)
public boolean isDescendentOf(PNode n)
public void walk(Proc1<PNode> p)
To walk a node and its descendents:
node.walk(new Proc1() { void call(PNode n) { // Process n before its chidren here. n.walkChildren(this); // Process n after its children here. } });
public void walkChildren(Proc1<PNode> p)
walk(Proc1 p)
public boolean isExpanded()
public void unlink()
public void addChild(PNode child, PNode after)
public void expandOneLevel(Refinement sourceRefinement, MatchEnv env)
Also instantiates the refinement, replacing with their values any variables that have values in 'env', and creates a map from the ids of child nodes to those children. The ids are taken from the node-specs in the refinement.
protected abstract PNode makePNode(PNode parent, LList pattern)
public PNodeEnd refToTimePoint(NodeEndRef ref)
expandOneLevel
method.
public void processOrderings(ix.icore.domain.ListOfOrdering orderings)
refToTimePoint(NodeEndRef)
to get each node-end.
public void ensureChildrenLinkedToParent()
public void computeStatus()
computeStatus
in interface HasStatus
public void setStatus(Status status)
setStatus
in interface HasStatus
public void assignStatus(Status status)
setStatus(Status)
should be
called instead.
public Status statusFromNodeEnds()
public static boolean allHaveStatus(java.util.List l, Status status)
public static void allComputeStatus(java.util.List l)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |