|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object TreeAgentState
public class TreeAgentState
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.
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 | |
---|---|
TreeAgentState()
Sets depth estimate to zero, parentId to -1, and m_bDfsFinished to false |
|
TreeAgentState(int nParentId,
boolean bDfsFinished)
Sets depth estimate to zero. |
|
TreeAgentState(int nDepth,
int nParentId,
boolean bDfsFinished)
|
|
TreeAgentState(TreeAgentState src)
Copy constructor - copies everything target information copied as well (valid if valid in src) |
Method Summary | |
---|---|
ILogicVarBundle |
getAlgVars()
Gets logic vars specific to this particular algorithm implementing the tree connectivity protocol |
java.lang.Boolean |
getBoolVar(java.lang.Object refObject)
gets a Boolean (wrapping a boolean) referred to by an object. |
int |
getCurrRound()
accessor for current round |
int |
getDepthEst()
|
boolean |
getDfsFinished()
|
int |
getFirstVisit()
|
int |
getId()
Gets unique Id of this agent |
java.lang.Integer |
getIntVar(java.lang.Object refObject)
gets an Integer (wrapping an int) referred to by an object. |
int |
getLastVisit()
|
boolean |
getParDepLess()
|
int |
getParentId()
|
int |
getParentProp()
|
int |
getParentsPar()
|
int |
getTargDepth()
|
int |
getTargetDepth()
returns depth for tree topology storage |
int |
getTargNChildren()
|
TreeAgentState |
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 |
boolean |
insertBoolVar(java.lang.Object refObject,
boolean bValue)
inserts an boolean value (see getBoolVar). |
boolean |
insertIntVar(java.lang.Object refObject,
int nValue)
inserts an integer value (see getIntVar(java.lang.Object) ). |
boolean |
isAncest(TreeAgentState stateB)
|
TreeAgentState |
makeCopy()
makes a copy and returns it |
void |
removeVar(java.lang.Object refObject)
Removes any values indexed by refObject |
void |
resetDepthEst()
|
void |
setAlgVars(ILogicVarBundle algVars)
Sets logic vars specific to this particular algorithm implementing the tree connectivity protocol |
void |
setDepthEst(int nNewDepth)
Not the preferred way to do this |
void |
setDfsFinished(boolean bFinished)
|
void |
setId(int nId)
Sets unique Id of this agent |
void |
setParDepLess(boolean bParDepLess)
|
void |
setParDepLess(TreeAgentState stateParent)
|
void |
setParentId(int nParentId)
|
void |
setParentProp(int nParentProp)
|
void |
setParentsPar(int nParentsParent)
|
TreeAgentState |
setTargetConfig(int nDepthFin,
int nFirst,
int nLast,
int nNumChilds)
Sets discrete (topological) component of target config info for this state |
TreeAgentState |
setTargetDepth(int nDepth)
|
void |
updateDepthEst(TreeAgentState stateParent)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ROUND_ATTACH
public static final int ROUND_UPDATE_DEPTH
public static final int ROUND_SET_PARLESS
public static final int ROUND_PROPOSE_NEW
Constructor Detail |
---|
public TreeAgentState(int nDepth, int nParentId, boolean bDfsFinished)
nDepth
- initial depth estimate (see 2006i)nParentId
- initial parent idbDfsFinished
- whether depth first search to determine
parent ids has finished for this node and all its childrenpublic TreeAgentState(int nParentId, boolean bDfsFinished)
Sets depth estimate to zero.
Final target configuration and topology information need to be set seperately.
nParentId
- initial parent idbDfsFinished
- whether depth first search to determine
parent ids has finished for this node and all its childrenpublic TreeAgentState()
Sets depth estimate to zero, parentId to -1, and m_bDfsFinished to false
Final target configuration and topology information need to be set seperately.
public TreeAgentState(TreeAgentState src)
src
- makes new copies of everything from this stateMethod Detail |
---|
public ILogicVarBundle getAlgVars()
public void setAlgVars(ILogicVarBundle algVars)
public TreeAgentState makeCopy()
makeCopy
in interface ILogicVarBundle
makeCopy
in interface IMsg
public java.lang.Integer getIntVar(java.lang.Object refObject)
getIntVar
in interface ILogicVarBundle
public void removeVar(java.lang.Object refObject)
removeVar
in interface ILogicVarBundle
refObject
- remove values associated with this.public boolean insertIntVar(java.lang.Object refObject, int nValue)
getIntVar(java.lang.Object)
). Returns false
if this insert was not permitted
insertIntVar
in interface ILogicVarBundle
getIntVar(java.lang.Object)
public java.lang.Boolean getBoolVar(java.lang.Object refObject)
getBoolVar
in interface ILogicVarBundle
public boolean insertBoolVar(java.lang.Object refObject, boolean bValue)
insertBoolVar
in interface ILogicVarBundle
getBoolVar(java.lang.Object)
public int getId()
ILogicVarBundle
getId
in interface ILogicVarBundle
public void setId(int nId)
ILogicVarBundle
setId
in interface ILogicVarBundle
public boolean getDfsFinished()
public void setDfsFinished(boolean bFinished)
public int getDepthEst()
public void updateDepthEst(TreeAgentState stateParent)
public void setDepthEst(int nNewDepth)
public void resetDepthEst()
public int getParentId()
public void setParentId(int nParentId)
public int getParentProp()
public void setParentProp(int nParentProp)
public boolean getParDepLess()
public void setParDepLess(boolean bParDepLess)
public void setParDepLess(TreeAgentState stateParent)
public int getParentsPar()
public void setParentsPar(int nParentsParent)
public TreeAgentState incrRound()
public int getCurrRound()
public int getTargetDepth()
public TreeAgentState setTargetDepth(int nDepth)
nDepth
- new target depth (do not confuse with depth estimate)
public boolean isAncest(TreeAgentState stateB)
stateB
- state to compare to
public TreeAgentState setTargetConfig(int nDepthFin, int nFirst, int nLast, int nNumChilds)
nDepthFin
- final depth in target confignFirst
- used by IsAncest to check ancestor relations -- see papernLast
- used by IsAncest to check ancestor relations -- see paper
public int getFirstVisit()
public int getLastVisit()
public int getTargDepth()
public int getTargNChildren()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |