Package pal.treesearch
Class PivotNode
- java.lang.Object
-
- pal.treesearch.AbstractParentableConstrainedNode
-
- pal.treesearch.PivotNode
-
- All Implemented Interfaces:
FreeNode,GeneralOptimisable,GeneralTreeComponent,GroupLeader,ParentableConstrainedNode,RootAccess
public class PivotNode extends AbstractParentableConstrainedNode implements GeneralOptimisable, ParentableConstrainedNode, FreeNode, RootAccess, GroupLeader
-
-
Constructor Summary
Constructors Constructor Description PivotNode(Node tree, FreeBranch parentConnection, GeneralConstructionTool tool, GeneralConstraintGroupManager constraintGroupManager, GeneralConstraintGroupManager.Store store)The subtree constructor with a connection to the rest of the treePivotNode(Node subTree, GeneralConstructionTool tool, GeneralConstraintGroupManager groupManager, GeneralConstraintGroupManager.Store store)The root constructor, only used when the whole tree is constrained
-
Method Summary
-
Methods inherited from class pal.treesearch.AbstractParentableConstrainedNode
adjustNodeHeight, buildDescendentPALNodeBase, buildDescendentPALNodeES, buildLeftDecendentPALNodeBase, buildRightDecendentPALNodeBase, getAllComponents, getConstrainedInternal, getDescendentExtendedConditionals, getDescendentExtendedConditionalsWithAdjustedInternalHeights, getDescendentFlatConditionals, getDescendentLogLikelihood, getDescendentPatternInfo, getLeftChild, getLeftChildPatternInfo, getLeftDescendentExtendedConditionals, getLeftDescendentExtendedConditionals, getMaxChildHeight, getMaxOriginalDescendentLeafHeight, getMinimumChildSeperation, getMinimumChildSeperation, getMinimumDirectChildDistance, getMinimumLeafChildSeperation, getMinimumLeafChildSeperation, getMinOriginalDescendentLeafHeight, getNodeHeight, getNonSubTreeOfChildComponents, getRightChild, getRightChildPatternInfo, getRightDescendentExtendedConditionals, getRightDescendentExtendedConditionals, getSubTreeComponents, isLeftChild, obtainConstrainedExternalCalculator, obtainLeafInformation, rebuildDescendentPattern, recursivelyAdjustNodeHeight, recursivelySetChildrenParentPivot, setNodeHeight, setupInternalNodeHeights, toStringHeights, toStringLengths, toStringLengths
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface pal.treesearch.GeneralTreeComponent
getAllComponents
-
Methods inherited from interface pal.treesearch.GroupLeader
obtainLeafInformation
-
Methods inherited from interface pal.treesearch.ParentableConstrainedNode
getNodeHeight, getNonSubTreeOfChildComponents
-
Methods inherited from interface pal.treesearch.RootAccess
getAllComponents
-
-
-
-
Constructor Detail
-
PivotNode
public PivotNode(Node tree, FreeBranch parentConnection, GeneralConstructionTool tool, GeneralConstraintGroupManager constraintGroupManager, GeneralConstraintGroupManager.Store store)
The subtree constructor with a connection to the rest of the tree- Parameters:
tree- the PAL node tree to base this tree onparentConnection- The connection with the rest of tree (must be free, otherwise this shouldn't be the pivot)tool- A general construction tool object for objtaining/building various componentsgroupConstraints- The constraints object that manages the leaf constraints
-
PivotNode
public PivotNode(Node subTree, GeneralConstructionTool tool, GeneralConstraintGroupManager groupManager, GeneralConstraintGroupManager.Store store)
The root constructor, only used when the whole tree is constrained- Parameters:
tool- A general construction tool object for objtaining/building various componentssubTree- The subtreegroupConstraints- The constraints object that manages the leaf constraints
-
-
Method Detail
-
postSetupNotify
public void postSetupNotify(ConstraintModel.GroupManager groupConstraints)
Description copied from interface:GroupLeaderTell the group leader that the groupConstraints have been set up (parameter wise), and that internal node heights for example may be calculated- Specified by:
postSetupNotifyin interfaceGroupLeader
-
buildPALNodeBase
public Node buildPALNodeBase()
- Specified by:
buildPALNodeBasein interfaceRootAccess
-
buildPALNodeES
public Node buildPALNodeES()
- Specified by:
buildPALNodeESin interfaceRootAccess
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getAscendentExtended
public ConditionalProbabilityStore getAscendentExtended(double baseHeight, ConstrainedNode childCaller, GeneralConstructionTool tool, boolean allowCaching)
- Specified by:
getAscendentExtendedin interfaceParentableConstrainedNode
-
getAscendentFlat
public ConditionalProbabilityStore getAscendentFlat(ConstrainedNode childCaller, GeneralConstructionTool tool, boolean allowCaching)
- Specified by:
getAscendentFlatin interfaceParentableConstrainedNode
-
getAscendentPatternInfo
public PatternInfo getAscendentPatternInfo(ConstrainedNode childCaller, GeneralConstructionTool tool)
- Specified by:
getAscendentPatternInfoin interfaceParentableConstrainedNode
-
calculateLogLikelihood
public double calculateLogLikelihood(GeneralConstructionTool tool)
- Specified by:
calculateLogLikelihoodin interfaceRootAccess
-
getPatternInfo
public PatternInfo getPatternInfo(GeneralConstructionTool tool, FreeBranch caller)
- Specified by:
getPatternInfoin interfaceFreeNode
-
hasConnection
public boolean hasConnection(FreeBranch c, FreeBranch caller)
- Specified by:
hasConnectionin interfaceFreeNode
-
getLeftBranch
public FreeBranch getLeftBranch(FreeBranch caller)
- Specified by:
getLeftBranchin interfaceFreeNode
-
getRightBranch
public FreeBranch getRightBranch(FreeBranch caller)
- Specified by:
getRightBranchin interfaceFreeNode
-
getAllComponents
public void getAllComponents(java.util.ArrayList store, java.lang.Class componentType, FreeBranch caller)Description copied from interface:FreeNodeRecurse to all neighbours but caller- Specified by:
getAllComponentsin interfaceFreeNode
-
testLikelihood
public void testLikelihood(FreeBranch caller, GeneralConstructionTool tool)
- Specified by:
testLikelihoodin interfaceFreeNode
-
testLikelihood
public void testLikelihood(GeneralConstructionTool tool)
- Specified by:
testLikelihoodin interfaceRootAccess
-
getLeftPatternInfo
public PatternInfo getLeftPatternInfo(GeneralConstructionTool tool, FreeBranch caller)
- Specified by:
getLeftPatternInfoin interfaceFreeNode- Returns:
- Get the pattern info for the relative left (from the caller's perspective), or null if not left pattern info
-
getRightPatternInfo
public PatternInfo getRightPatternInfo(GeneralConstructionTool tool, FreeBranch caller)
- Specified by:
getRightPatternInfoin interfaceFreeNode- Returns:
- Get the pattern info for the relative right (from the caller's perspective), or null if not right pattern info
-
getExtendedConditionalProbabilities
public ConditionalProbabilityStore getExtendedConditionalProbabilities(double distance, FreeBranch caller, GeneralConstructionTool tool)
- Specified by:
getExtendedConditionalProbabilitiesin interfaceFreeNode
-
getExtendedConditionalProbabilities
public ConditionalProbabilityStore getExtendedConditionalProbabilities(double distance, FreeBranch caller, UnconstrainedLikelihoodModel.External external, ConditionalProbabilityStore resultStore, GeneralConstructionTool tool)
- Specified by:
getExtendedConditionalProbabilitiesin interfaceFreeNode
-
extract
public FreeBranch extract(FreeBranch caller)
We can't extract
-
buildPALNodeES
public Node buildPALNodeES(double branchLength_, FreeBranch caller)
- Specified by:
buildPALNodeESin interfaceFreeNode
-
buildPALNodeBase
public Node buildPALNodeBase(double branchLength_, FreeBranch caller)
- Specified by:
buildPALNodeBasein interfaceFreeNode
-
getFlatConditionalProbabilities
public ConditionalProbabilityStore getFlatConditionalProbabilities(FreeBranch caller, GeneralConstructionTool tool)
- Specified by:
getFlatConditionalProbabilitiesin interfaceFreeNode
-
toString
public java.lang.String toString(FreeBranch caller)
-
setConnectingBranches
public void setConnectingBranches(FreeBranch[] store, int number)
- Specified by:
setConnectingBranchesin interfaceFreeNode
-
hasDirectConnection
public boolean hasDirectConnection(FreeBranch query)
- Specified by:
hasDirectConnectionin interfaceFreeNode
-
swapConnection
public void swapConnection(FreeBranch original, FreeBranch newConnection)
Should not do anything but swap branches around- Specified by:
swapConnectionin interfaceFreeNode
-
swapConnection
public void swapConnection(FreeBranch original, FreeNode nodeToReplace, FreeBranch newConnection)
Should preserve tree integrity- Specified by:
swapConnectionin interfaceFreeNode
-
getNonSubTreeComponents
public void getNonSubTreeComponents(java.util.ArrayList store, java.lang.Class componentType)- Specified by:
getNonSubTreeComponentsin classAbstractParentableConstrainedNode
-
getNumberOfOptimisationTypes
public int getNumberOfOptimisationTypes()
- Specified by:
getNumberOfOptimisationTypesin interfaceGeneralOptimisable
-
optimise
public double optimise(int optimisationType, UnivariateMinimum minimiser, GeneralConstructionTool tool, int fracDigits)- Specified by:
optimisein interfaceGeneralOptimisableminimiser- The single dimensional minimisation tooltool- The construction toolfracDigits- the number of fractional digits to converge to- Returns:
- The optimised log likelihood, or >0 if not optimisation occured
-
-