| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
package dr.evomodel.operators; |
| 27 |
|
| 28 |
import dr.inference.operators.SimpleMCMCOperator; |
| 29 |
import dr.evomodel.tree.EmpiricalTreeDistributionModel; |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
public class EmpiricalTreeDistributionOperator extends SimpleMCMCOperator { |
| 36 |
|
| 37 |
public static final String EMPIRICAL_TREE_DISTRIBUTION_OPERATOR = "empiricalTreeDistributionOperator"; |
| 38 |
public static final String METROPOLIS_HASTINGS = "metropolisHastings"; |
| 39 |
|
| 40 |
private final EmpiricalTreeDistributionModel treeModel; |
| 41 |
private final boolean metropolisHastings; |
| 42 |
|
| 43 |
public EmpiricalTreeDistributionOperator(EmpiricalTreeDistributionModel treeModel, boolean metropolisHastings, double weight) { |
| 44 |
this.treeModel = treeModel; |
| 45 |
setWeight(weight); |
| 46 |
this.metropolisHastings = metropolisHastings; |
| 47 |
} |
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
public double doOperation() { |
| 53 |
treeModel.drawTreeIndex(); |
| 54 |
|
| 55 |
if (metropolisHastings) { |
| 56 |
return 0.0; |
| 57 |
} |
| 58 |
|
| 59 |
|
| 60 |
return Double.POSITIVE_INFINITY; |
| 61 |
} |
| 62 |
|
| 63 |
public String getPerformanceSuggestion() { |
| 64 |
return ""; |
| 65 |
} |
| 66 |
|
| 67 |
public String getOperatorName() { |
| 68 |
return EMPIRICAL_TREE_DISTRIBUTION_OPERATOR; |
| 69 |
} |
| 70 |
|
| 71 |
} |