View Javadoc

1   /*
2    * Copyright 2006 - 2012 Christina Bohk and Roland Ewald
3    *  
4    * Licensed under the Apache License, Version 2.0 (the "License"); 
5    * you may not use this file except in compliance with the License. 
6    * You may obtain a copy of the License at 
7    *  
8    *  http://www.apache.org/licenses/LICENSE-2.0
9    *  
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
13   * See the License for the specific language governing permissions and 
14   * limitations under the License. 
15   */
16  package p3j.experiment.results;
17  
18  import p3j.misc.math.Matrix2D;
19  
20  /**
21   * Represents the fundamental set of results calculated by the system.
22   * 
23   * Only the end and mean populations are considered as final results and will
24   * per persisted (NOT the survival probabilities!).
25   * 
26   * Created on July 04, 2006
27   * 
28   * @author Christina Bohk
29   * @author Roland Ewald
30   * 
31   */
32  public class BasicResults {
33  
34    /** The id. */
35    private int id;
36  
37    /** The name of the sub-population this result belongs to. */
38    private String subPopName;
39  
40    /**
41     * The generation of the sub-population (0 if no generations are
42     * distinguished).
43     */
44    private int generation;
45  
46    /**
47     * Year-by-year age-specific male population at the end of the year (101 x n
48     * matrix).
49     */
50    private Matrix2D endXm;
51  
52    /**
53     * Year-by-year age-specific female population at the end of the year (101 x n
54     * matrix).
55     */
56    private Matrix2D endXf;
57  
58    /** Year-by-year age-specific mean male population (101 x n matrix). */
59    private Matrix2D meanXm;
60  
61    /**
62     * Year-by-year age-specific mean female population (101 x n matrix).
63     */
64    private Matrix2D meanXf;
65  
66    /**
67     * Year-by-year age-specific male survival probability in the first half of
68     * the year.
69     */
70    private Matrix2D p1m;
71  
72    /**
73     * Year-by-year age-specific female survival probability in the first half of
74     * the year.
75     */
76    private Matrix2D p1f;
77  
78    /**
79     * Year-by-year age-specific male survival probability in the second half of
80     * the year.
81     */
82    private Matrix2D p2m;
83  
84    /**
85     * Year-by-year age-specific female survival probability in the second half of
86     * the year.
87     */
88    private Matrix2D p2f;
89  
90    /**
91     * Default constructor.
92     * 
93     * @param subPopulationName
94     *          the sub-population name
95     * @param numOfYears
96     *          number of years to be predicted
97     * @param maxAge
98     *          the maximum age
99     */
100   public BasicResults(String subPopulationName, int subPopGeneration,
101       int numOfYears, int maxAge) {
102 
103     this.subPopName = subPopulationName;
104     this.generation = subPopGeneration;
105 
106     this.endXm = new Matrix2D(maxAge + 1, numOfYears);
107     this.endXf = new Matrix2D(maxAge + 1, numOfYears);
108     this.meanXm = new Matrix2D(maxAge + 1, numOfYears);
109     this.meanXf = new Matrix2D(maxAge + 1, numOfYears);
110 
111     this.p1m = new Matrix2D(maxAge, numOfYears);
112     this.p1f = new Matrix2D(maxAge, numOfYears);
113     this.p2m = new Matrix2D(maxAge, numOfYears);
114     this.p2f = new Matrix2D(maxAge, numOfYears);
115 
116   }
117 
118   /**
119    * Constructor for bean compliance. Do NOT use manually.
120    */
121   public BasicResults() {
122   }
123 
124   public Matrix2D getEndXm() {
125     return endXm;
126   }
127 
128   public void setEndXm(Matrix2D endXm) {
129     this.endXm = endXm;
130   }
131 
132   public Matrix2D getEndXf() {
133     return endXf;
134   }
135 
136   public void setEndXf(Matrix2D endXf) {
137     this.endXf = endXf;
138   }
139 
140   public Matrix2D getMeanXm() {
141     return meanXm;
142   }
143 
144   public void setMeanXm(Matrix2D meanXm) {
145     this.meanXm = meanXm;
146   }
147 
148   public Matrix2D getMeanXf() {
149     return meanXf;
150   }
151 
152   public void setMeanXf(Matrix2D meanXf) {
153     this.meanXf = meanXf;
154   }
155 
156   public Matrix2D getP1m() {
157     return p1m;
158   }
159 
160   public void setP1m(Matrix2D p1m) {
161     this.p1m = p1m;
162   }
163 
164   public Matrix2D getP1f() {
165     return p1f;
166   }
167 
168   public void setP1f(Matrix2D p1f) {
169     this.p1f = p1f;
170   }
171 
172   public Matrix2D getP2m() {
173     return p2m;
174   }
175 
176   public void setP2m(Matrix2D p2m) {
177     this.p2m = p2m;
178   }
179 
180   public Matrix2D getP2f() {
181     return p2f;
182   }
183 
184   public void setP2f(Matrix2D p2f) {
185     this.p2f = p2f;
186   }
187 
188   public int getID() {
189     return id;
190   }
191 
192   public void setID(int id) {
193     this.id = id;
194   }
195 
196   public String getSubPopName() {
197     return subPopName;
198   }
199 
200   public void setSubPopName(String subPopName) {
201     this.subPopName = subPopName;
202   }
203 
204   public int getGeneration() {
205     return generation;
206   }
207 
208   public void setGeneration(int generation) {
209     this.generation = generation;
210   }
211 
212 }