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  	/**
38  	 * Year-by-year age-specific male population at the end of the year (101 x n
39  	 * matrix).
40  	 */
41  	private Matrix2D endXm;
42  
43  	/**
44  	 * Year-by-year age-specific female population at the end of the year (101 x n
45  	 * matrix).
46  	 */
47  	private Matrix2D endXf;
48  
49  	/** Year-by-year age-specific mean male population (101 x n matrix). */
50  	private Matrix2D meanXm;
51  
52  	/**
53  	 * Year-by-year age-specific mean female population (101 x n matrix).
54  	 */
55  	private Matrix2D meanXf;
56  
57  	/**
58  	 * Year-by-year age-specific male survival probability in the first half of
59  	 * the year.
60  	 */
61  	private Matrix2D p1m;
62  
63  	/**
64  	 * Year-by-year age-specific female survival probability in the first half of
65  	 * the year.
66  	 */
67  	private Matrix2D p1f;
68  
69  	/**
70  	 * Year-by-year age-specific male survival probability in the second half of
71  	 * the year.
72  	 */
73  	private Matrix2D p2m;
74  
75  	/**
76  	 * Year-by-year age-specific female survival probability in the second half of
77  	 * the year.
78  	 */
79  	private Matrix2D p2f;
80  
81  	/**
82  	 * Default constructor.
83  	 * 
84  	 * @param numOfYears
85  	 *          number of years to be predicted
86  	 * @param maxAge
87  	 *          the maximum age
88  	 */
89  	public BasicResults(int numOfYears, int maxAge) {
90  
91  		this.endXm = new Matrix2D(maxAge + 1, numOfYears);
92  		this.endXf = new Matrix2D(maxAge + 1, numOfYears);
93  		this.meanXm = new Matrix2D(maxAge + 1, numOfYears);
94  		this.meanXf = new Matrix2D(maxAge + 1, numOfYears);
95  
96  		this.p1m = new Matrix2D(maxAge, numOfYears);
97  		this.p1f = new Matrix2D(maxAge, numOfYears);
98  		this.p2m = new Matrix2D(maxAge, numOfYears);
99  		this.p2f = new Matrix2D(maxAge, numOfYears);
100 
101 	}
102 
103 	/**
104 	 * Constructor for bean compliance. Do NOT use manually.
105 	 */
106 	public BasicResults() {
107 	}
108 
109 	public Matrix2D getEndXm() {
110 		return endXm;
111 	}
112 
113 	public void setEndXm(Matrix2D endXm) {
114 		this.endXm = endXm;
115 	}
116 
117 	public Matrix2D getEndXf() {
118 		return endXf;
119 	}
120 
121 	public void setEndXf(Matrix2D endXf) {
122 		this.endXf = endXf;
123 	}
124 
125 	public Matrix2D getMeanXm() {
126 		return meanXm;
127 	}
128 
129 	public void setMeanXm(Matrix2D meanXm) {
130 		this.meanXm = meanXm;
131 	}
132 
133 	public Matrix2D getMeanXf() {
134 		return meanXf;
135 	}
136 
137 	public void setMeanXf(Matrix2D meanXf) {
138 		this.meanXf = meanXf;
139 	}
140 
141 	public Matrix2D getP1m() {
142 		return p1m;
143 	}
144 
145 	public void setP1m(Matrix2D p1m) {
146 		this.p1m = p1m;
147 	}
148 
149 	public Matrix2D getP1f() {
150 		return p1f;
151 	}
152 
153 	public void setP1f(Matrix2D p1f) {
154 		this.p1f = p1f;
155 	}
156 
157 	public Matrix2D getP2m() {
158 		return p2m;
159 	}
160 
161 	public void setP2m(Matrix2D p2m) {
162 		this.p2m = p2m;
163 	}
164 
165 	public Matrix2D getP2f() {
166 		return p2f;
167 	}
168 
169 	public void setP2f(Matrix2D p2f) {
170 		this.p2f = p2f;
171 	}
172 
173 	public int getID() {
174 		return id;
175 	}
176 
177 	public void setID(int id) {
178 		this.id = id;
179 	}
180 
181 }