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) double
extract
(FreeBranch caller) We can't extractvoid
getAllComponents
(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) void
getNonSubTreeComponents
(ArrayList store, Class componentType) int
getPatternInfo
(GeneralConstructionTool tool, FreeBranch caller) getRightBranch
(FreeBranch caller) getRightPatternInfo
(GeneralConstructionTool tool, FreeBranch caller) boolean
hasConnection
(FreeBranch c, FreeBranch caller) boolean
hasDirectConnection
(FreeBranch query) double
optimise
(int optimisationType, UnivariateMinimum minimiser, GeneralConstructionTool tool, int fracDigits) void
postSetupNotify
(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 calculatedvoid
setConnectingBranches
(FreeBranch[] store, int number) void
swapConnection
(FreeBranch original, FreeBranch newConnection) Should not do anything but swap branches aroundvoid
swapConnection
(FreeBranch original, FreeNode nodeToReplace, FreeBranch newConnection) Should preserve tree integrityvoid
testLikelihood
(FreeBranch caller, GeneralConstructionTool tool) void
toString()
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, 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 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:
subTree
- The subtreetool
- A general construction tool object for objtaining/building various componentsgroupConstraints
- The constraints object that manages the leaf constraints
-
-
Method Details
-
postSetupNotify
Description copied from interface:GroupLeader
Tell the group leader that the groupConstraints have been set up (parameter wise), and that internal node heights for example may be calculated- Specified by:
postSetupNotify
in interfaceGroupLeader
-
buildPALNodeBase
- Specified by:
buildPALNodeBase
in interfaceRootAccess
-
buildPALNodeES
- Specified by:
buildPALNodeES
in interfaceRootAccess
-
toString
-
getAscendentExtended
public ConditionalProbabilityStore getAscendentExtended(double baseHeight, ConstrainedNode childCaller, GeneralConstructionTool tool, boolean allowCaching) - Specified by:
getAscendentExtended
in interfaceParentableConstrainedNode
-
getAscendentFlat
public ConditionalProbabilityStore getAscendentFlat(ConstrainedNode childCaller, GeneralConstructionTool tool, boolean allowCaching) - Specified by:
getAscendentFlat
in interfaceParentableConstrainedNode
-
getAscendentPatternInfo
public PatternInfo getAscendentPatternInfo(ConstrainedNode childCaller, GeneralConstructionTool tool) - Specified by:
getAscendentPatternInfo
in interfaceParentableConstrainedNode
-
calculateLogLikelihood
- Specified by:
calculateLogLikelihood
in interfaceRootAccess
-
getPatternInfo
- Specified by:
getPatternInfo
in interfaceFreeNode
-
hasConnection
- Specified by:
hasConnection
in interfaceFreeNode
-
getLeftBranch
- Specified by:
getLeftBranch
in interfaceFreeNode
-
getRightBranch
- Specified by:
getRightBranch
in interfaceFreeNode
-
getAllComponents
Description copied from interface:FreeNode
Recurse to all neighbours but caller- Specified by:
getAllComponents
in interfaceFreeNode
-
testLikelihood
- Specified by:
testLikelihood
in interfaceFreeNode
-
testLikelihood
- Specified by:
testLikelihood
in interfaceRootAccess
-
getLeftPatternInfo
- Specified by:
getLeftPatternInfo
in interfaceFreeNode
- Parameters:
caller
-- Returns:
- Get the pattern info for the relative left (from the caller's perspective), or null if not left pattern info
-
getRightPatternInfo
- Specified by:
getRightPatternInfo
in interfaceFreeNode
- Parameters:
caller
-- 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:
getExtendedConditionalProbabilities
in interfaceFreeNode
-
getExtendedConditionalProbabilities
public ConditionalProbabilityStore getExtendedConditionalProbabilities(double distance, FreeBranch caller, UnconstrainedLikelihoodModel.External external, ConditionalProbabilityStore resultStore, GeneralConstructionTool tool) - Specified by:
getExtendedConditionalProbabilities
in interfaceFreeNode
-
extract
We can't extract -
buildPALNodeES
- Specified by:
buildPALNodeES
in interfaceFreeNode
-
buildPALNodeBase
- Specified by:
buildPALNodeBase
in interfaceFreeNode
-
getFlatConditionalProbabilities
public ConditionalProbabilityStore getFlatConditionalProbabilities(FreeBranch caller, GeneralConstructionTool tool) - Specified by:
getFlatConditionalProbabilities
in interfaceFreeNode
-
toString
-
setConnectingBranches
- Specified by:
setConnectingBranches
in interfaceFreeNode
-
hasDirectConnection
- Specified by:
hasDirectConnection
in interfaceFreeNode
-
swapConnection
Should not do anything but swap branches around- Specified by:
swapConnection
in interfaceFreeNode
-
swapConnection
Should preserve tree integrity- Specified by:
swapConnection
in interfaceFreeNode
-
getNonSubTreeComponents
- Specified by:
getNonSubTreeComponents
in classAbstractParentableConstrainedNode
-
getNumberOfOptimisationTypes
public int getNumberOfOptimisationTypes()- Specified by:
getNumberOfOptimisationTypes
in interfaceGeneralOptimisable
-
optimise
public double optimise(int optimisationType, UnivariateMinimum minimiser, GeneralConstructionTool tool, int fracDigits) - Specified by:
optimise
in interfaceGeneralOptimisable
- Parameters:
minimiser
- 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
-