Debian Codegraph @

src/dr/evomodel/alloppnet/speciation/AlloppNetworkPriorModel.java

raw symbols SCIP
1 /*
2 * AlloppNetworkPriorModel.java
3 *
4 * Copyright (c) 2002-2017 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.alloppnet.speciation;
27
28 import dr.evolution.util.Units;
29 import dr.evomodel.alloppnet.parsers.AlloppNetworkPriorModelParser;
30 import dr.inference.distribution.ParametricDistributionModel;
31 import dr.inference.model.AbstractModel;
32 import dr.inference.model.Model;
33 import dr.inference.model.Parameter;
34 import dr.inference.model.Variable;
35 import dr.inference.model.Variable.ChangeType;
36
37
38
39 /**
40 *
41 * Model for prior of an allopolyploid network.
42 *
43 * @author Graham Jones
44 * Date: 01/07/2011
45 */
46
47
48 /*
49
50
51
52
53
54 */
55
56 public class AlloppNetworkPriorModel extends AbstractModel implements Units {
57 private Parameter rate;
58 private Parameter popsf;
59 private ParametricDistributionModel tpmodel;
60 private ParametricDistributionModel rpmodel;
61 private ParametricDistributionModel hpmodel;
62 private Units.Type units;
63
64
65 public AlloppNetworkPriorModel(Parameter eventrate, Parameter popscalingfactor,
66 ParametricDistributionModel tippopmodel, ParametricDistributionModel rootpopmodel,
67 ParametricDistributionModel hybpopmodel, Units.Type units) {
68 super(AlloppNetworkPriorModelParser.ALLOPPNETWORKPRIORMODEL);
69 this.rate = eventrate;
70 this.popsf = popscalingfactor;
71 this.tpmodel = tippopmodel;
72 this.rpmodel = rootpopmodel;
73 this.hpmodel = hybpopmodel;
74 this.units = units;
75 addVariable(rate);
76 addVariable(popsf);
77 }
78
79
80 Parameter getRate() {
81 return rate;
82 }
83
84
85 Parameter getPopScalingFactor() {
86 return popsf;
87 }
88
89 ParametricDistributionModel getTipPopModel() {
90 return tpmodel;
91 }
92
93 ParametricDistributionModel getRootPopModel() {
94 return rpmodel;
95 }
96
97 ParametricDistributionModel getHybridPopModel() {
98 return hpmodel;
99 }
100
101
102 @Override
103 protected void handleModelChangedEvent(Model model, Object object, int index) {
104 if (AlloppSpeciesNetworkModel.DBUGTUNE)
105 System.out.println("AlloppNetworkPriorModel.handleModelChangedEvent() " + model.getId());
106 }
107
108 @Override
109 protected void handleVariableChangedEvent(Variable variable, int index,
110 ChangeType type) {
111 if (AlloppSpeciesNetworkModel.DBUGTUNE)
112 System.out.println("AlloppNetworkPriorModel.handleModelChangedEvent() " + variable.getId());
113 }
114
115 @Override
116 protected void storeState() {
117 // addVariable(rate), addVariable(popsf) deal with this
118 if (AlloppSpeciesNetworkModel.DBUGTUNE)
119 System.out.println("AlloppNetworkPriorModel.storeState()");
120
121 }
122
123 @Override
124 protected void restoreState() {
125 // addVariable(rate), addVariable(popsf) deal with this
126 if (AlloppSpeciesNetworkModel.DBUGTUNE)
127 System.out.println("AlloppNetworkPriorModel.restoreState()");
128
129 }
130
131 @Override
132 protected void acceptState() {
133 }
134
135 public Type getUnits() {
136 return units;
137 }
138
139 public void setUnits(Type units) {
140 // grjtodo-oneday allow units other than substitutions
141
142 }
143
144 }