Debian Codegraph @

src/dr/evomodel/epidemiology/casetocase/AbstractCase.java

raw symbols SCIP
1 /*
2 * AbstractCase.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.epidemiology.casetocase;
27
28 import dr.evolution.util.Date;
29 import dr.evolution.util.Taxa;
30 import dr.inference.model.AbstractModel;
31 import dr.inference.model.Parameter;
32
33 import java.util.ArrayList;
34
35 /**
36 * Abstract class for outbreak; best implemented as an inner class in implementations of AbstractOutbreak
37 *
38 * User: Matthew Hall
39 * Date: 15/04/13
40 */
41
42
43 public abstract class AbstractCase extends AbstractModel {
44
45 public AbstractCase(String name){
46 super(name);
47 }
48
49 protected String caseID;
50 protected Taxa associatedTaxa;
51 protected double endOfInfectiousTime;
52 protected boolean wasEverInfected;
53 protected Parameter infectionBranchPosition;
54
55 public String getName(){
56 return caseID;
57 }
58
59 public Taxa getAssociatedTaxa() {
60 return associatedTaxa;
61 }
62
63 public double getEndTime(){
64 return endOfInfectiousTime;
65 }
66
67 public abstract boolean noninfectiousYet(double time);
68
69 public String toString(){
70 return caseID;
71 }
72
73 public abstract double[] getCoords();
74
75 public boolean wasEverInfected(){
76 return wasEverInfected;
77 }
78
79 public Parameter getInfectionBranchPosition(){
80 return infectionBranchPosition;
81 }
82
83 public abstract ArrayList<Date> getExaminationTimes();
84
85 public void setInfectionBranchPosition(double value){
86 infectionBranchPosition.setParameterValue(0, value);
87 }
88
89 public void setEverInfected(boolean value){
90 wasEverInfected = value;
91 }
92
93
94 }
95