Package pal.treesearch
Class FreeLeafNode
java.lang.Object
pal.treesearch.AbstractLeafNode
pal.treesearch.FreeLeafNode
- All Implemented Interfaces:
FreeNode
,GeneralTreeComponent
-
Constructor Summary
ConstructorsConstructorDescriptionFreeLeafNode
(FreeBranch parentBranch, String id, GeneralConstructionTool tool) -
Method Summary
Modifier and TypeMethodDescriptionfinal Node
buildPALNode
(double branchLength, FreeBranch caller) final Node
buildPALNodeBase
(double branchLength, FreeBranch caller) final Node
buildPALNodeES
(double branchLength, FreeBranch caller) extract
(FreeBranch caller) Instruct the node to extract itself from the two connections that aren't the caller One of the other two connections will become redunant.final void
getAllComponents
(ArrayList store, Class componentType) void
getAllComponents
(ArrayList store, Class componentType, FreeBranch caller) Recurse to all neighbours but callervoid
getAllConnections
(ArrayList store, FreeBranch caller) getExtendedConditionalProbabilities
(double distance, FreeBranch callingBranch, UnconstrainedLikelihoodModel.External external, ConditionalProbabilityStore resultStore, GeneralConstructionTool tool) getExtendedConditionalProbabilities
(double distance, FreeBranch callingBranch, GeneralConstructionTool tool) getFlatConditionalProbabilities
(FreeBranch callingBranch, UnconstrainedLikelihoodModel.External external, ConditionalProbabilityStore resultStore, GeneralConstructionTool tool) getFlatConditionalProbabilities
(FreeBranch caller, GeneralConstructionTool tool) getLeftBranch
(FreeBranch caller) getLeftExtendedConditionalProbabilities
(FreeBranch caller, UnconstrainedLikelihoodModel.External externalCalculator, ConditionalProbabilityStore resultStore) getLeftPatternInfo
(GeneralConstructionTool tool, FreeBranch caller) getPatternInfo
(GeneralConstructionTool tool, FreeBranch caller) getRightBranch
(FreeBranch caller) getRightExtendedConditionalProbabilities
(FreeBranch caller, UnconstrainedLikelihoodModel.External externalCalculator, ConditionalProbabilityStore resultStore) getRightPatternInfo
(GeneralConstructionTool tool, FreeBranch caller) boolean
hasConnection
(FreeBranch fb, FreeBranch caller) boolean
void
mark()
void
rebuildConnectionPatterns
(GeneralConstructionTool tool, FreeBranch caller) int
This should only be called by another leaf node on the other end of the connection.void
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) toString
(FreeBranch caller) void
Methods inherited from class pal.treesearch.AbstractLeafNode
createNewConstrainedLeafCalculator, createNewFreeLeafCalculator, getLabel, getNumberOfPatterns, getPatternInfo
-
Constructor Details
-
FreeLeafNode
-
-
Method Details
-
hasDirectConnection
- Specified by:
hasDirectConnection
in interfaceFreeNode
-
mark
public void mark() -
undoToMark
public void undoToMark() -
hasConnection
- Specified by:
hasConnection
in interfaceFreeNode
-
extract
Description copied from interface:FreeNode
Instruct the node to extract itself from the two connections that aren't the caller One of the other two connections will become redunant. -
getLeftExtendedConditionalProbabilities
public ConditionalProbabilityStore getLeftExtendedConditionalProbabilities(FreeBranch caller, UnconstrainedLikelihoodModel.External externalCalculator, ConditionalProbabilityStore resultStore) -
getRightExtendedConditionalProbabilities
public ConditionalProbabilityStore getRightExtendedConditionalProbabilities(FreeBranch caller, UnconstrainedLikelihoodModel.External externalCalculator, ConditionalProbabilityStore resultStore) -
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
-
setConnectingBranches
- Specified by:
setConnectingBranches
in interfaceFreeNode
-
testLikelihood
- Specified by:
testLikelihood
in interfaceFreeNode
-
swapConnection
Description copied from interface:FreeNode
Should not do anything but swap branches around- Specified by:
swapConnection
in interfaceFreeNode
-
swapConnection
Description copied from interface:FreeNode
Should preserve tree integrity- Specified by:
swapConnection
in interfaceFreeNode
-
getLeftBranch
- Specified by:
getLeftBranch
in interfaceFreeNode
- Returns:
- null (as not possible)
-
getRightBranch
- Specified by:
getRightBranch
in interfaceFreeNode
- Returns:
- null (as not possible)
-
getAllConnections
-
getPatternInfo
- Specified by:
getPatternInfo
in interfaceFreeNode
-
rebuildConnectionPatterns
-
redirectRebuildPattern
This should only be called by another leaf node on the other end of the connection. In this case we don't have to do much (tree is two node tree) -
getFlatConditionalProbabilities
public final ConditionalProbabilityStore getFlatConditionalProbabilities(FreeBranch callingBranch, UnconstrainedLikelihoodModel.External external, ConditionalProbabilityStore resultStore, GeneralConstructionTool tool) -
getFlatConditionalProbabilities
public final ConditionalProbabilityStore getFlatConditionalProbabilities(FreeBranch caller, GeneralConstructionTool tool) - Specified by:
getFlatConditionalProbabilities
in interfaceFreeNode
-
getExtendedConditionalProbabilities
public ConditionalProbabilityStore getExtendedConditionalProbabilities(double distance, FreeBranch callingBranch, UnconstrainedLikelihoodModel.External external, ConditionalProbabilityStore resultStore, GeneralConstructionTool tool) - Specified by:
getExtendedConditionalProbabilities
in interfaceFreeNode
-
getExtendedConditionalProbabilities
public ConditionalProbabilityStore getExtendedConditionalProbabilities(double distance, FreeBranch callingBranch, GeneralConstructionTool tool) - Specified by:
getExtendedConditionalProbabilities
in interfaceFreeNode
-
buildPALNode
-
buildPALNodeES
- Specified by:
buildPALNodeES
in interfaceFreeNode
-
buildPALNodeBase
- Specified by:
buildPALNodeBase
in interfaceFreeNode
-
toString
-
getAllComponents
Description copied from interface:FreeNode
Recurse to all neighbours but caller- Specified by:
getAllComponents
in interfaceFreeNode
-
getAllComponents
- Specified by:
getAllComponents
in interfaceGeneralTreeComponent
-