Class TreeConstraintState

java.lang.Object
  extended by LogicVarIntLookup
      extended by TreeConstraintState
All Implemented Interfaces:
ILogicVarBundle, IMsg

public class TreeConstraintState
extends LogicVarIntLookup
implements ILogicVarBundle, IMsg

Discrete state for tree re-arrangement agent

Future work -- currently the "target topology information" specific to "Formation Morphing Algorithm" is combined with this class. This should not be the case. The two should be separated, and Formation Morphing Algorithm should have its own class to store this info.

Since:
1.0

Field Summary
static int ROUND_ATTACH
          faked enum for differentiating rounds
static int ROUND_PROPOSE_NEW
          faked enum for differentiating rounds
static int ROUND_SET_PARLESS
          faked enum for differentiating rounds
static int ROUND_UPDATE_DEPTH
          faked enum for differentiating rounds
 
Constructor Summary
TreeConstraintState()
          Sets depth estimate to zero, parentId to -1, and m_bDfsFinished to false
TreeConstraintState(int nParentId)
          Sets depth estimate to zero.
TreeConstraintState(int nDepth, int nParentId)
           
TreeConstraintState(TreeConstraintState src)
          Copy constructor - copies everything target information copied as well (valid if valid in src)
 
Method Summary
 void clearDepTarg()
           
 int getCurrRound()
          accessor for current round
 java.lang.Integer getDepTarg()
           
 int getDepthEst()
           
 boolean getIncreaseDepth()
           
 IMsg getMsgAddition(java.lang.reflect.Type t)
           
 boolean getParDepLess()
           
 int getParentId()
           
 int getParentProp()
           
 int getRootId()
           
 TreeConstraintState incrRound()
          Increment round counter (e.g which round of the algorithm we're on) This is essential for correct negotiation of constraint tree topology re-arrangements
 TreeConstraintState makeCopy()
          makes a copy and returns it
 void resetDepthEst()
           
 void setDepTarg(int nDepTarg)
           
 void setDepthEst(int nNewDepth)
          Not the preferred way to do this
 void setIncreaseDepth(boolean bIncreaseDepth)
           
 void setMsgAddition(java.lang.reflect.Type t, IMsg msg)
           
 void setParDepLess(boolean bParDepLess)
           
 void setParDepLess(TreeConstraintState stateParent)
           
 void setParentId(int nParentId)
           
 void setParentProp(int nParentProp)
           
 void setRootId(int nRoot)
           
 void updateDepthEst(TreeConstraintState stateParent, int nNumStates)
           
 
Methods inherited from class LogicVarIntLookup
copyFrom, getBoolVar, getId, getIntVar, insertBoolVar, insertIntVar, removeVar, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ILogicVarBundle
getBoolVar, getId, getIntVar, insertBoolVar, insertIntVar, removeVar, setId
 

Field Detail

ROUND_ATTACH

public static final int ROUND_ATTACH
faked enum for differentiating rounds

See Also:
Constant Field Values

ROUND_UPDATE_DEPTH

public static final int ROUND_UPDATE_DEPTH
faked enum for differentiating rounds

See Also:
Constant Field Values

ROUND_SET_PARLESS

public static final int ROUND_SET_PARLESS
faked enum for differentiating rounds

See Also:
Constant Field Values

ROUND_PROPOSE_NEW

public static final int ROUND_PROPOSE_NEW
faked enum for differentiating rounds

See Also:
Constant Field Values
Constructor Detail

TreeConstraintState

public TreeConstraintState(int nDepth,
                           int nParentId)
Parameters:
nDepth - initial depth estimate (see 2006i)
nParentId - initial parent id parent ids has finished for this node and all its children

TreeConstraintState

public TreeConstraintState(int nParentId)

Sets depth estimate to zero.

Final target configuration and topology information need to be set seperately.

Parameters:
nParentId - initial parent id parent ids has finished for this node and all its children

TreeConstraintState

public TreeConstraintState()

Sets depth estimate to zero, parentId to -1, and m_bDfsFinished to false

Final target configuration and topology information need to be set seperately.


TreeConstraintState

public TreeConstraintState(TreeConstraintState src)
Copy constructor - copies everything target information copied as well (valid if valid in src)

Parameters:
src - makes new copies of everything from this state
Method Detail

setMsgAddition

public void setMsgAddition(java.lang.reflect.Type t,
                           IMsg msg)

getMsgAddition

public IMsg getMsgAddition(java.lang.reflect.Type t)

makeCopy

public TreeConstraintState makeCopy()
makes a copy and returns it

Specified by:
makeCopy in interface ILogicVarBundle
Specified by:
makeCopy in interface IMsg
Overrides:
makeCopy in class LogicVarIntLookup

getDepTarg

public java.lang.Integer getDepTarg()

setDepTarg

public void setDepTarg(int nDepTarg)

clearDepTarg

public void clearDepTarg()

setIncreaseDepth

public void setIncreaseDepth(boolean bIncreaseDepth)

getIncreaseDepth

public boolean getIncreaseDepth()

getDepthEst

public int getDepthEst()

updateDepthEst

public void updateDepthEst(TreeConstraintState stateParent,
                           int nNumStates)

setDepthEst

public void setDepthEst(int nNewDepth)
Not the preferred way to do this


resetDepthEst

public void resetDepthEst()

getRootId

public int getRootId()

setRootId

public void setRootId(int nRoot)

getParentId

public int getParentId()

setParentId

public void setParentId(int nParentId)

getParentProp

public int getParentProp()

setParentProp

public void setParentProp(int nParentProp)

getParDepLess

public boolean getParDepLess()

setParDepLess

public void setParDepLess(boolean bParDepLess)

setParDepLess

public void setParDepLess(TreeConstraintState stateParent)

incrRound

public TreeConstraintState incrRound()
Increment round counter (e.g which round of the algorithm we're on) This is essential for correct negotiation of constraint tree topology re-arrangements

Returns:
this

getCurrRound

public int getCurrRound()
accessor for current round