small modifications for data collection
authorjzhou <jzhou>
Mon, 17 Mar 2008 22:42:17 +0000 (22:42 +0000)
committerjzhou <jzhou>
Mon, 17 Mar 2008 22:42:17 +0000 (22:42 +0000)
Robust/src/Benchmarks/PERT/Java/Stage.java
Robust/src/Benchmarks/PERT/Tag/Stage.java
Robust/src/Benchmarks/TileSearch/Tag/GlobalCounter.java
Robust/src/Benchmarks/TileSearch/Tag/TileSearch.java

index abc5ba98c5c7b24c7acca26e346472f5c16e2f0f..cd275912e1fc267cd815ad10228099bd472034ef 100644 (file)
@@ -30,14 +30,19 @@ public class Stage {
                        int tmp = samplings[samplings.length];
                }*/
 
-       Random r = new Random();
+       /*Random r = new Random();
        int tint = 0;
        for(int i = 0; i < this.samplings.length; ++i) {
            do {
                tint = r.nextInt()%50;
            } while(tint <= 0);
            this.samplings[i] = tint;
-           //System./*out.print*/printString(tint + "; ");
+           //System./*out.print*///printString(tint + "; ");
+//     }
+    int tint = ID * 3;
+       for(int i = 0; i < this.samplings.length; ++i) {
+               this.samplings[i] = tint + i;
+               //System.printString(tint + "; ");
        }
        //System.printString("\n");//out.println();
     }
index a2f9b787ba6469acb93b71c7dbe8b7cb95aa133c..9791ffa2a0b0c64b37cd13f03f91e960864cd0fe 100644 (file)
@@ -32,7 +32,7 @@ public class Stage {
                        int tmp = samplings[samplings.length];
                }*/
 
-       Random r = new Random();
+       /*Random r = new Random();
        int tint = 0;
        for(int i = 0; i < this.samplings.length; ++i) {
            do {
@@ -40,6 +40,11 @@ public class Stage {
            } while(tint <= 0);
            this.samplings[i] = tint;
            //System.printString(tint + "; ");
+       }*/
+       int tint = ID * 3;
+       for(int i = 0; i < this.samplings.length; ++i) {
+               this.samplings[i] = tint + i;
+               //System.printString(tint + "; ");
        }
        //System.printString("\n");
     }
index 53e02583f01f000c6a3f13d5790a7d96021d25ac..68f853e6826fd7e337ddbc158a095e58610d3b4f 100644 (file)
@@ -1,8 +1,10 @@
 public class GlobalCounter {
     flag Init;
     public int counter;
+       public boolean partial;
 
     public GlobalCounter() {
        counter = 0;
+       partial = false;
     }
 }
index 686d68c8e7fabe4737a5e175d5ba3ebc7884e408..ded343e103730c66f3cc4c84bf949110d904acfe 100644 (file)
@@ -95,8 +95,12 @@ task Startup( StartupObject s{ initialstate } )
     taskexit( s{ !initialstate } );
 }
 
-task findNewFits( SubProblem sp{ findingNewFits }, GlobalCounter counter{ Init })
+task findNewFits(optional SubProblem sp{ findingNewFits }, GlobalCounter counter{ Init })
 {
+       if(!isavailable(sp)) {
+               counter.partial = true;
+               taskexit( sp{ !findingNewFits } );
+       }
        System.printString("Top of task findNewFits\n");
     // if we have run out of iterations of the
     // findNewFits task, mark waitingForSubProblems
@@ -198,22 +202,22 @@ task scoreSubProbleam(SubProblem sp{ !scored && leaf }) {
 }
 
 //check the highest score
-task findHighestScore(SubProblem pSp{ !scored && main }, /*optional*/ SubProblem cSp{ scored && leaf }, GlobalCounter counter{ Init } ) {
+task findHighestScore(SubProblem pSp{ !scored && main }, optional SubProblem cSp{ scored && leaf }, GlobalCounter counter{ Init } ) {
        System.printString("Top of task findHighestScore\n");
     --counter.counter;
     //System.printString( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" );
     //System.printString( "find highest score:\n" + counter.counter + "\n" );
     //System.printString( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" );
-    //if(isavailable(cSp)) {
+    if(isavailable(cSp)) {
        if(pSp.highScore < cSp.highScore) {
            pSp.highScore = cSp.highScore;
        }
-       if(cSp.partial == true) {
+       if((counter.partial == true) || (cSp.partial == true)) {
            pSp.partial = true;
        }
-    /*} else {
+    } else {
        pSp.partial = true;
-    }*/
+    }
     if(counter.counter == 0) {
        taskexit(pSp{ scored }, cSp{ !leaf });
     } else {