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
ConstructorsConstructorDescriptionPivotNode(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
Modifier and TypeMethodDescriptionbuildPALNodeBase(double branchLength_, FreeBranch caller) buildPALNodeES(double branchLength_, FreeBranch caller) doubleextract(FreeBranch caller) We can't extractvoidgetAllComponents(ArrayList store, Class componentType, FreeBranch caller) Recurse to all neighbours but callergetAscendentExtended(double baseHeight, ConstrainedNode childCaller, GeneralConstructionTool tool, boolean allowCaching) getAscendentFlat(ConstrainedNode childCaller, GeneralConstructionTool tool, boolean allowCaching) getAscendentPatternInfo(ConstrainedNode childCaller, GeneralConstructionTool tool) getExtendedConditionalProbabilities(double distance, FreeBranch caller, UnconstrainedLikelihoodModel.External external, ConditionalProbabilityStore resultStore, GeneralConstructionTool tool) getExtendedConditionalProbabilities(double distance, FreeBranch caller, GeneralConstructionTool tool) getFlatConditionalProbabilities(FreeBranch caller, GeneralConstructionTool tool) getLeftBranch(FreeBranch caller) getLeftPatternInfo(GeneralConstructionTool tool, FreeBranch caller) voidgetNonSubTreeComponents(ArrayList store, Class componentType) intgetPatternInfo(GeneralConstructionTool tool, FreeBranch caller) getRightBranch(FreeBranch caller) getRightPatternInfo(GeneralConstructionTool tool, FreeBranch caller) booleanhasConnection(FreeBranch c, FreeBranch caller) booleanhasDirectConnection(FreeBranch query) doubleoptimise(int optimisationType, UnivariateMinimum minimiser, GeneralConstructionTool tool, int fracDigits) voidpostSetupNotify(ConstraintModel.GroupManager groupConstraints) Tell the group leader that the groupConstraints have been set up (parameter wise), and that internal node heights for example may be calculatedvoidsetConnectingBranches(FreeBranch[] store, int number) voidswapConnection(FreeBranch original, FreeBranch newConnection) Should not do anything but swap branches aroundvoidswapConnection(FreeBranch original, FreeNode nodeToReplace, FreeBranch newConnection) Should preserve tree integrityvoidtestLikelihood(FreeBranch caller, GeneralConstructionTool tool) voidtoString()toString(FreeBranch caller) 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, toStringLengthsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface pal.treesearch.GeneralTreeComponent
getAllComponentsMethods inherited from interface pal.treesearch.GroupLeader
obtainLeafInformationMethods inherited from interface pal.treesearch.ParentableConstrainedNode
getNodeHeight, getNonSubTreeOfChildComponentsMethods inherited from interface pal.treesearch.RootAccess
getAllComponents
-
Constructor Details
-
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 Details
-
postSetupNotify
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
- Specified by:
buildPALNodeBasein interfaceRootAccess
-
buildPALNodeES
- Specified by:
buildPALNodeESin interfaceRootAccess
-
toString
-
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
- Specified by:
calculateLogLikelihoodin interfaceRootAccess
-
getPatternInfo
- Specified by:
getPatternInfoin interfaceFreeNode
-
hasConnection
- Specified by:
hasConnectionin interfaceFreeNode
-
getLeftBranch
- Specified by:
getLeftBranchin interfaceFreeNode
-
getRightBranch
- Specified by:
getRightBranchin interfaceFreeNode
-
getAllComponents
Description copied from interface:FreeNodeRecurse to all neighbours but caller- Specified by:
getAllComponentsin interfaceFreeNode
-
testLikelihood
- Specified by:
testLikelihoodin interfaceFreeNode
-
testLikelihood
- Specified by:
testLikelihoodin interfaceRootAccess
-
getLeftPatternInfo
- 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
- 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
We can't extract -
buildPALNodeES
- Specified by:
buildPALNodeESin interfaceFreeNode
-
buildPALNodeBase
- Specified by:
buildPALNodeBasein interfaceFreeNode
-
getFlatConditionalProbabilities
public ConditionalProbabilityStore getFlatConditionalProbabilities(FreeBranch caller, GeneralConstructionTool tool) - Specified by:
getFlatConditionalProbabilitiesin interfaceFreeNode
-
toString
-
setConnectingBranches
- Specified by:
setConnectingBranchesin interfaceFreeNode
-
hasDirectConnection
- Specified by:
hasDirectConnectionin interfaceFreeNode
-
swapConnection
Should not do anything but swap branches around- Specified by:
swapConnectionin interfaceFreeNode
-
swapConnection
Should preserve tree integrity- Specified by:
swapConnectionin interfaceFreeNode
-
getNonSubTreeComponents
- 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
-