Debian Codegraph @

src/dr/evomodel/branchratemodel/DefaultBranchRateModel.java

raw symbols SCIP
1 /*
2 * DefaultBranchRateModel.java
3 *
4 * Copyright (c) 2002-2015 Alexei Drummond, Andrew Rambaut and Marc Suchard
5 *
6 * This file is part of BEAST.
7 * See the NOTICE file distributed with this work for additional
8 * information regarding copyright ownership and licensing.
9 *
10 * BEAST is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Lesser General Public License as
12 * published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
14 *
15 * BEAST is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with BEAST; if not, write to the
22 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
23 * Boston, MA 02110-1301 USA
24 */
25
26 package dr.evomodel.branchratemodel;
27
28 import dr.evolution.tree.*;
29 import dr.inference.model.Model;
30 import dr.inference.model.ModelListener;
31 import dr.inference.model.Variable;
32
33 /**
34 * @author Andrew Rambaut
35 * @version $Id: DefaultBranchRateModel.java,v 1.4 2005/05/24 20:25:57 rambaut Exp $
36 */
37 public final class DefaultBranchRateModel implements BranchRateModel {
38 public double getBranchRate(Tree tree, NodeRef node) {
39 return 1.0;
40 }
41
42 public void addModelListener(ModelListener listener) {
43 // nothing to do
44 }
45
46 public void removeModelListener(ModelListener listener) {
47 // nothing to do
48 }
49
50 public void storeModelState() {
51 // nothing to do
52 }
53
54 public void restoreModelState() {
55 // nothing to do
56 }
57
58 public void acceptModelState() {
59 // nothing to do
60 }
61
62 public boolean isValidState() {
63 return true;
64 }
65
66 public int getModelCount() {
67 return 0;
68 }
69
70 public Model getModel(int i) {
71 return null;
72 }
73
74 public int getVariableCount() {
75 return 0;
76 }
77
78 public Variable getVariable(int i) {
79 return null;
80 }
81
82 public String getModelName() {
83 return null;
84 }
85
86 public String getId() {
87 return null;
88 }
89
90 public void setId(String id) {
91 // nothing to do
92 }
93
94 public boolean isUsed() {
95 return false;
96 }
97
98 public String getTraitName() {
99 return RATE;
100 }
101
102 public Intent getIntent() {
103 return Intent.BRANCH;
104 }
105
106 public boolean getLoggable() {
107 return true;
108 }
109
110 public TreeTrait getTreeTrait(final String key) {
111 return this;
112 }
113
114 public TreeTrait[] getTreeTraits() {
115 return new TreeTrait[] { this };
116 }
117
118 public Class getTraitClass() {
119 return Double.class;
120 }
121
122 public int getDimension() {
123 return 1;
124 }
125
126 public Double getTrait(final Tree tree, final NodeRef node) {
127 return getBranchRate(tree, node);
128 }
129
130 public String getTraitString(final Tree tree, final NodeRef node) {
131 return Double.toString(getBranchRate(tree, node));
132 }
133 }