| 1 | /* |
| 2 | * FiniteSetParameter.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.inference.model; |
| 27 | |
| 28 | /** |
| 29 | * @author Marc A. Suchard |
| 30 | */ |
| 31 | |
| 32 | public class FiniteSetParameter extends Parameter.Abstract implements VariableListener { |
| 33 | |
| 34 | public void variableChangedEvent(Variable variable, int index, ChangeType type) { |
| 35 | //To change body of implemented methods use File | Settings | File Templates. |
| 36 | } |
| 37 | |
| 38 | protected void storeValues() { |
| 39 | indicator.storeParameterValues(); |
| 40 | } |
| 41 | |
| 42 | protected void restoreValues() { |
| 43 | indicator.restoreParameterValues(); |
| 44 | } |
| 45 | |
| 46 | protected void acceptValues() { |
| 47 | //To change body of implemented methods use File | Settings | File Templates. |
| 48 | } |
| 49 | |
| 50 | protected void adoptValues(Parameter source) { |
| 51 | //To change body of implemented methods use File | Settings | File Templates. |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * @param dim the index of the parameter dimension of interest |
| 56 | * @return the parameter's scalar value in the given dimension |
| 57 | */ |
| 58 | public double getParameterValue(int dim) { |
| 59 | return 0; //To change body of implemented methods use File | Settings | File Templates. |
| 60 | } |
| 61 | |
| 62 | /** |
| 63 | * sets the scalar value in the given dimension of this parameter |
| 64 | * |
| 65 | * @param dim the index of the dimension to set |
| 66 | * @param value the value to set |
| 67 | */ |
| 68 | public void setParameterValue(int dim, double value) { |
| 69 | //To change body of implemented methods use File | Settings | File Templates. |
| 70 | } |
| 71 | |
| 72 | /** |
| 73 | * sets the scalar value in the given dimensin of this parameter to val, without firing any events |
| 74 | * |
| 75 | * @param dim the index of the dimension to set |
| 76 | * @param value the value to set |
| 77 | */ |
| 78 | public void setParameterValueQuietly(int dim, double value) { |
| 79 | //To change body of implemented methods use File | Settings | File Templates. |
| 80 | } |
| 81 | |
| 82 | /** |
| 83 | * sets the scalar value in the given dimensin of this parameter to val, |
| 84 | * and notifies that values in all dimension have been changed |
| 85 | * |
| 86 | * @param dim the index of the dimension to set |
| 87 | * @param value the value to set |
| 88 | */ |
| 89 | public void setParameterValueNotifyChangedAll(int dim, double value) { |
| 90 | //To change body of implemented methods use File | Settings | File Templates. |
| 91 | } |
| 92 | |
| 93 | /** |
| 94 | * @return the name of this parameter |
| 95 | */ |
| 96 | public String getParameterName() { |
| 97 | return null; //To change body of implemented methods use File | Settings | File Templates. |
| 98 | } |
| 99 | |
| 100 | /** |
| 101 | * Adds new bounds to this parameter |
| 102 | * |
| 103 | * @param bounds to add |
| 104 | */ |
| 105 | public void addBounds(Bounds<Double> bounds) { |
| 106 | //To change body of implemented methods use File | Settings | File Templates. |
| 107 | } |
| 108 | |
| 109 | /** |
| 110 | * @return the intersection of all bounds added to this parameter |
| 111 | */ |
| 112 | public Bounds<Double> getBounds() { |
| 113 | return null; //To change body of implemented methods use File | Settings | File Templates. |
| 114 | } |
| 115 | |
| 116 | /** |
| 117 | * Adds an extra dimension at the given index |
| 118 | * |
| 119 | * @param index Index of the dimension to add |
| 120 | * @param value value to save at end of new array |
| 121 | */ |
| 122 | public void addDimension(int index, double value) { |
| 123 | //To change body of implemented methods use File | Settings | File Templates. |
| 124 | } |
| 125 | |
| 126 | /** |
| 127 | * Removes the specified dimension from parameter |
| 128 | * |
| 129 | * @param index Index of dimension to lose |
| 130 | * @return the value of the dimension removed |
| 131 | */ |
| 132 | public double removeDimension(int index) { |
| 133 | return 0; //To change body of implemented methods use File | Settings | File Templates. |
| 134 | } |
| 135 | |
| 136 | private Parameter indicator; |
| 137 | |
| 138 | } |