1 /**************************************************************************
3 * Java Grande Forum Benchmark Suite - Version 2.0 *
7 * Java Grande Benchmarking Project *
11 * Edinburgh Parallel Computing Centre *
13 * email: epcc-javagrande@epcc.ed.ac.uk *
15 * Original version of this code by Hon Yau (hwyau@epcc.ed.ac.uk) *
17 * This version copyright (c) The University of Edinburgh, 1999. *
18 * All rights reserved. *
20 **************************************************************************/
23 * Class for defining the initialisation data for all tasks.
26 * @version $Revision: 1.1 $ $Date: 2010/07/23 03:44:00 $
28 public class ToInitAllTasks {
29 private String header;
31 private int startDate;
34 private int returnDefinition;
35 private double expectedReturnRate;
36 private double volatility;
37 private int nTimeSteps;
38 private double pathStartValue;
41 * Constructor, for initialisation data which are common to all computation
45 * Simple header string.
47 * The name of the security which this Monte Carlo path should
50 * The date when the path starts, in 'YYYYMMDD' format.
52 * The date when the path ends, in 'YYYYMMDD' format.
54 * The interval in the data between successive data points in the
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.
63 * The measured volatility for which to generate.
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
70 public ToInitAllTasks(String header, String name, int startDate, int endDate, double dTime,
71 int returnDefinition, double expectedReturnRate, double volatility, double pathStartValue) {
74 this.startDate = startDate;
75 this.endDate = endDate;
77 this.returnDefinition = returnDefinition;
78 this.expectedReturnRate = expectedReturnRate;
79 this.volatility = volatility;
80 this.nTimeSteps = nTimeSteps;
81 this.pathStartValue = pathStartValue;
85 * Another constructor, slightly easier to use by having slightly fewer
86 * arguments. Makes use of the "ReturnPath" object to accomplish this.
89 * Object used to define the instance variables which should be
90 * carried over to this object.
92 * The number of time steps which the Monte Carlo generator should
94 * @param pathStartValue
95 * The stock price value to use at the start of each Monte Carlo
97 * @exception DemoException
98 * thrown if there is a problem accessing the instance variables
99 * from the target objetct.
101 public ToInitAllTasks(ReturnPath obj, int nTimeSteps, double pathStartValue) {
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();
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;
117 // ------------------------------------------------------------------------
118 // Accessor methods for class ToInitAllTasks.
119 // Generated by 'makeJavaAccessor.pl' script. HWY. 20th January 1999.
120 // ------------------------------------------------------------------------
122 * Accessor method for private instance variable <code>header</code>.
124 * @return Value of instance variable <code>header</code>.
126 public String get_header() {
127 return (this.header);
131 * Set method for private instance variable <code>header</code>.
134 * the value to set for the instance variable <code>header</code>.
136 public void set_header(String header) {
137 this.header = header;
141 * Accessor method for private instance variable <code>name</code>.
143 * @return Value of instance variable <code>name</code>.
145 public String get_name() {
150 * Set method for private instance variable <code>name</code>.
153 * the value to set for the instance variable <code>name</code>.
155 public void set_name(String name) {
160 * Accessor method for private instance variable <code>startDate</code>.
162 * @return Value of instance variable <code>startDate</code>.
164 public int get_startDate() {
165 return (this.startDate);
169 * Set method for private instance variable <code>startDate</code>.
172 * the value to set for the instance variable <code>startDate</code>.
174 public void set_startDate(int startDate) {
175 this.startDate = startDate;
179 * Accessor method for private instance variable <code>endDate</code>.
181 * @return Value of instance variable <code>endDate</code>.
183 public int get_endDate() {
184 return (this.endDate);
188 * Set method for private instance variable <code>endDate</code>.
191 * the value to set for the instance variable <code>endDate</code>.
193 public void set_endDate(int endDate) {
194 this.endDate = endDate;
198 * Accessor method for private instance variable <code>dTime</code>.
200 * @return Value of instance variable <code>dTime</code>.
202 public double get_dTime() {
207 * Set method for private instance variable <code>dTime</code>.
210 * the value to set for the instance variable <code>dTime</code>.
212 public void set_dTime(double dTime) {
217 * Accessor method for private instance variable <code>returnDefinition</code>
220 * @return Value of instance variable <code>returnDefinition</code>.
222 public int get_returnDefinition() {
223 return (this.returnDefinition);
227 * Set method for private instance variable <code>returnDefinition</code>.
229 * @param returnDefinition
230 * the value to set for the instance variable
231 * <code>returnDefinition</code>.
233 public void set_returnDefinition(int returnDefinition) {
234 this.returnDefinition = returnDefinition;
238 * Accessor method for private instance variable
239 * <code>expectedReturnRate</code>.
241 * @return Value of instance variable <code>expectedReturnRate</code>.
243 public double get_expectedReturnRate() {
244 return (this.expectedReturnRate);
248 * Set method for private instance variable <code>expectedReturnRate</code>.
250 * @param expectedReturnRate
251 * the value to set for the instance variable
252 * <code>expectedReturnRate</code>.
254 public void set_expectedReturnRate(double expectedReturnRate) {
255 this.expectedReturnRate = expectedReturnRate;
259 * Accessor method for private instance variable <code>volatility</code>.
261 * @return Value of instance variable <code>volatility</code>.
263 public double get_volatility() {
264 return (this.volatility);
268 * Set method for private instance variable <code>volatility</code>.
271 * the value to set for the instance variable <code>volatility</code>
274 public void set_volatility(double volatility) {
275 this.volatility = volatility;
279 * Accessor method for private instance variable <code>nTimeSteps</code>.
281 * @return Value of instance variable <code>nTimeSteps</code>.
283 public int get_nTimeSteps() {
284 return (this.nTimeSteps);
288 * Set method for private instance variable <code>nTimeSteps</code>.
291 * the value to set for the instance variable <code>nTimeSteps</code>
294 public void set_nTimeSteps(int nTimeSteps) {
295 this.nTimeSteps = nTimeSteps;
299 * Accessor method for private instance variable <code>pathStartValue</code>.
301 * @return Value of instance variable <code>pathStartValue</code>.
303 public double get_pathStartValue() {
304 return (this.pathStartValue);
308 * Set method for private instance variable <code>pathStartValue</code>.
310 * @param pathStartValue
311 * the value to set for the instance variable
312 * <code>pathStartValue</code>.
314 public void set_pathStartValue(double pathStartValue) {
315 this.pathStartValue = pathStartValue;
317 // ------------------------------------------------------------------------