8 public int returnDefinition;
9 public float expectedReturnRate;
10 public float volatility;
11 public int nTimeSteps;
12 public float pathStartValue;
14 int id, nRunsMC, group;
15 //ToInitAllTasks toinitalltasks;
16 public Vector results;
18 public AppDemoRunner(int id,
22 /*ToInitAllTasks initalltask*/) {
26 this.results = new Vector();
28 //this.header = initalltask.header;
30 this.startDate = ad.startDate;
31 this.endDate = ad.endDate;
32 this.dTime = ad.dTime;
33 this.returnDefinition = ad.returnDefinition;
34 this.expectedReturnRate = ad.expectedReturnRate;
35 this.volatility = ad.volatility;
36 this.nTimeSteps = ad.nTimeStepsMC;
37 this.pathStartValue = ad.pathStartValue;
41 // Now do the computation.
42 int ilow, iupper, slice;
45 int nruns = this.nRunsMC;
47 slice = (nruns + gp-1)/gp;
50 iupper = (index+1)*slice;
55 for(int iRun=ilow; iRun < iupper; iRun++ ) {
56 //String header="MC run "+String.valueOf(iRun);
57 PriceStock ps = new PriceStock();
58 ps.setInitAllTasks(this);
59 ps.setTask(/*header, */(long)iRun*11);
61 results.addElement(ps.getResult());
64 public static void main(String[] args) {
65 int datasize = 10000; //should be times of 2
66 int nruns = 62 * 62; //16 * 16;
67 int group = 62; // 16;
69 AppDemo ad = new AppDemo(datasize, nruns, group);
72 for(int i = 0; i < group; i++) {
73 AppDemoRunner adr = new AppDemoRunner(i, nruns, group, ad);