Skip to content

Commit

Permalink
PrunedRelaxedClockModel is broken after meanRate is changed to Function
Browse files Browse the repository at this point in the history
  • Loading branch information
walterxie committed Jul 29, 2021
1 parent 7cd6d32 commit c88e042
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import beast.core.Description;
import beast.core.Input;
import beast.core.StateNode;
import beast.core.parameter.RealParameter;
import beast.evolution.tree.Node;
import beast.evolution.tree.PrunedTree;
import beast.evolution.tree.TreeInterface;
Expand Down Expand Up @@ -67,8 +69,11 @@ protected boolean requiresRecalculation() {
}

private boolean rq() {
if (! (rates.meanRate instanceof RealParameter) )
throw new UnsupportedOperationException("meanRate has to be RealParameter !");

// before tree, since tree might not be valid if only rates changed
if( rates.distribution.isDirtyCalculation() || rates.meanRate.somethingIsDirty() ) {
if( rates.distribution.isDirtyCalculation() || ((RealParameter) rates.meanRate).somethingIsDirty() ) {
return true;
}

Expand Down

0 comments on commit c88e042

Please sign in to comment.