bug fix: heap contexts for call sites were propgated from caller to callee incorrectl...
[IRC.git] / Robust / src / Benchmarks / oooJava / monte / ToInitAllTasks.java
1 /**************************************************************************
2  *                                                                         *
3  *             Java Grande Forum Benchmark Suite - Version 2.0             *
4  *                                                                         *
5  *                            produced by                                  *
6  *                                                                         *
7  *                  Java Grande Benchmarking Project                       *
8  *                                                                         *
9  *                                at                                       *
10  *                                                                         *
11  *                Edinburgh Parallel Computing Centre                      *
12  *                                                                         *
13  *                email: epcc-javagrande@epcc.ed.ac.uk                     *
14  *                                                                         *
15  *      Original version of this code by Hon Yau (hwyau@epcc.ed.ac.uk)     *
16  *                                                                         *
17  *      This version copyright (c) The University of Edinburgh, 1999.      *
18  *                         All rights reserved.                            *
19  *                                                                         *
20  **************************************************************************/
21
22 /**
23  * Class for defining the initialisation data for all tasks.
24  * 
25  * @author H W Yau
26  * @version $Revision: 1.1 $ $Date: 2010/07/23 03:44:00 $
27  */
28 public class ToInitAllTasks {
29   private String header;
30   private String name;
31   private int startDate;
32   private int endDate;
33   private double dTime;
34   private int returnDefinition;
35   private double expectedReturnRate;
36   private double volatility;
37   private int nTimeSteps;
38   private double pathStartValue;
39
40   /**
41    * Constructor, for initialisation data which are common to all computation
42    * tasks.
43    * 
44    * @param header
45    *          Simple header string.
46    * @param name
47    *          The name of the security which this Monte Carlo path should
48    *          represent.
49    * @param startDate
50    *          The date when the path starts, in 'YYYYMMDD' format.
51    * @param endDate
52    *          The date when the path ends, in 'YYYYMMDD' format.
53    * @param dTime
54    *          The interval in the data between successive data points in the
55    *          generated path.
56    * @param returnDefinition
57    *          How the statistic variables were defined, according to the
58    *          definitions in <code>ReturnPath</code>'s two class variables
59    *          <code>COMPOUNDED</code> and <code>NONCOMPOUNDED</code>.
60    * @param expectedReturnRate
61    *          The measured expected return rate for which to generate.
62    * @param volatility
63    *          The measured volatility for which to generate.
64    * @param nTimeSteps
65    *          The number of time steps for which to generate.
66    * @param pathStartValue
67    *          The stock price value to use at the start of each Monte Carlo
68    *          simulation path.
69    */
70   public ToInitAllTasks(String header, String name, int startDate, int endDate, double dTime,
71       int returnDefinition, double expectedReturnRate, double volatility, double pathStartValue) {
72     this.header = header;
73     this.name = name;
74     this.startDate = startDate;
75     this.endDate = endDate;
76     this.dTime = dTime;
77     this.returnDefinition = returnDefinition;
78     this.expectedReturnRate = expectedReturnRate;
79     this.volatility = volatility;
80     this.nTimeSteps = nTimeSteps;
81     this.pathStartValue = pathStartValue;
82   }
83
84   /**
85    * Another constructor, slightly easier to use by having slightly fewer
86    * arguments. Makes use of the "ReturnPath" object to accomplish this.
87    * 
88    * @param obj
89    *          Object used to define the instance variables which should be
90    *          carried over to this object.
91    * @param nTimeSteps
92    *          The number of time steps which the Monte Carlo generator should
93    *          make.
94    * @param pathStartValue
95    *          The stock price value to use at the start of each Monte Carlo
96    *          simulation path.
97    * @exception DemoException
98    *              thrown if there is a problem accessing the instance variables
99    *              from the target objetct.
100    */
101   public ToInitAllTasks(ReturnPath obj, int nTimeSteps, double pathStartValue) {
102     //
103     // Instance variables defined in the PathId object.
104     this.name = obj.get_name();
105     this.startDate = obj.get_startDate();
106     this.endDate = obj.get_endDate();
107     this.dTime = obj.get_dTime();
108     //
109     // Instance variables defined in ReturnPath object.
110     this.returnDefinition = obj.get_returnDefinition();
111     this.expectedReturnRate = obj.get_expectedReturnRate();
112     this.volatility = obj.get_volatility();
113     this.nTimeSteps = nTimeSteps;
114     this.pathStartValue = pathStartValue;
115   }
116
117   // ------------------------------------------------------------------------
118   // Accessor methods for class ToInitAllTasks.
119   // Generated by 'makeJavaAccessor.pl' script. HWY. 20th January 1999.
120   // ------------------------------------------------------------------------
121   /**
122    * Accessor method for private instance variable <code>header</code>.
123    * 
124    * @return Value of instance variable <code>header</code>.
125    */
126   public String get_header() {
127     return (this.header);
128   }
129
130   /**
131    * Set method for private instance variable <code>header</code>.
132    * 
133    * @param header
134    *          the value to set for the instance variable <code>header</code>.
135    */
136   public void set_header(String header) {
137     this.header = header;
138   }
139
140   /**
141    * Accessor method for private instance variable <code>name</code>.
142    * 
143    * @return Value of instance variable <code>name</code>.
144    */
145   public String get_name() {
146     return (this.name);
147   }
148
149   /**
150    * Set method for private instance variable <code>name</code>.
151    * 
152    * @param name
153    *          the value to set for the instance variable <code>name</code>.
154    */
155   public void set_name(String name) {
156     this.name = name;
157   }
158
159   /**
160    * Accessor method for private instance variable <code>startDate</code>.
161    * 
162    * @return Value of instance variable <code>startDate</code>.
163    */
164   public int get_startDate() {
165     return (this.startDate);
166   }
167
168   /**
169    * Set method for private instance variable <code>startDate</code>.
170    * 
171    * @param startDate
172    *          the value to set for the instance variable <code>startDate</code>.
173    */
174   public void set_startDate(int startDate) {
175     this.startDate = startDate;
176   }
177
178   /**
179    * Accessor method for private instance variable <code>endDate</code>.
180    * 
181    * @return Value of instance variable <code>endDate</code>.
182    */
183   public int get_endDate() {
184     return (this.endDate);
185   }
186
187   /**
188    * Set method for private instance variable <code>endDate</code>.
189    * 
190    * @param endDate
191    *          the value to set for the instance variable <code>endDate</code>.
192    */
193   public void set_endDate(int endDate) {
194     this.endDate = endDate;
195   }
196
197   /**
198    * Accessor method for private instance variable <code>dTime</code>.
199    * 
200    * @return Value of instance variable <code>dTime</code>.
201    */
202   public double get_dTime() {
203     return (this.dTime);
204   }
205
206   /**
207    * Set method for private instance variable <code>dTime</code>.
208    * 
209    * @param dTime
210    *          the value to set for the instance variable <code>dTime</code>.
211    */
212   public void set_dTime(double dTime) {
213     this.dTime = dTime;
214   }
215
216   /**
217    * Accessor method for private instance variable <code>returnDefinition</code>
218    * .
219    * 
220    * @return Value of instance variable <code>returnDefinition</code>.
221    */
222   public int get_returnDefinition() {
223     return (this.returnDefinition);
224   }
225
226   /**
227    * Set method for private instance variable <code>returnDefinition</code>.
228    * 
229    * @param returnDefinition
230    *          the value to set for the instance variable
231    *          <code>returnDefinition</code>.
232    */
233   public void set_returnDefinition(int returnDefinition) {
234     this.returnDefinition = returnDefinition;
235   }
236
237   /**
238    * Accessor method for private instance variable
239    * <code>expectedReturnRate</code>.
240    * 
241    * @return Value of instance variable <code>expectedReturnRate</code>.
242    */
243   public double get_expectedReturnRate() {
244     return (this.expectedReturnRate);
245   }
246
247   /**
248    * Set method for private instance variable <code>expectedReturnRate</code>.
249    * 
250    * @param expectedReturnRate
251    *          the value to set for the instance variable
252    *          <code>expectedReturnRate</code>.
253    */
254   public void set_expectedReturnRate(double expectedReturnRate) {
255     this.expectedReturnRate = expectedReturnRate;
256   }
257
258   /**
259    * Accessor method for private instance variable <code>volatility</code>.
260    * 
261    * @return Value of instance variable <code>volatility</code>.
262    */
263   public double get_volatility() {
264     return (this.volatility);
265   }
266
267   /**
268    * Set method for private instance variable <code>volatility</code>.
269    * 
270    * @param volatility
271    *          the value to set for the instance variable <code>volatility</code>
272    *          .
273    */
274   public void set_volatility(double volatility) {
275     this.volatility = volatility;
276   }
277
278   /**
279    * Accessor method for private instance variable <code>nTimeSteps</code>.
280    * 
281    * @return Value of instance variable <code>nTimeSteps</code>.
282    */
283   public int get_nTimeSteps() {
284     return (this.nTimeSteps);
285   }
286
287   /**
288    * Set method for private instance variable <code>nTimeSteps</code>.
289    * 
290    * @param nTimeSteps
291    *          the value to set for the instance variable <code>nTimeSteps</code>
292    *          .
293    */
294   public void set_nTimeSteps(int nTimeSteps) {
295     this.nTimeSteps = nTimeSteps;
296   }
297
298   /**
299    * Accessor method for private instance variable <code>pathStartValue</code>.
300    * 
301    * @return Value of instance variable <code>pathStartValue</code>.
302    */
303   public double get_pathStartValue() {
304     return (this.pathStartValue);
305   }
306
307   /**
308    * Set method for private instance variable <code>pathStartValue</code>.
309    * 
310    * @param pathStartValue
311    *          the value to set for the instance variable
312    *          <code>pathStartValue</code>.
313    */
314   public void set_pathStartValue(double pathStartValue) {
315     this.pathStartValue = pathStartValue;
316   }
317   // ------------------------------------------------------------------------
318 }