From: jzhou Date: Mon, 17 Mar 2008 22:42:17 +0000 (+0000) Subject: small modifications for data collection X-Git-Tag: preEdgeChange~228 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8d52d7f1d04d8277ba33f58dce3d6cc4772f072a;p=IRC.git small modifications for data collection --- diff --git a/Robust/src/Benchmarks/PERT/Java/Stage.java b/Robust/src/Benchmarks/PERT/Java/Stage.java index abc5ba98..cd275912 100644 --- a/Robust/src/Benchmarks/PERT/Java/Stage.java +++ b/Robust/src/Benchmarks/PERT/Java/Stage.java @@ -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(); } diff --git a/Robust/src/Benchmarks/PERT/Tag/Stage.java b/Robust/src/Benchmarks/PERT/Tag/Stage.java index a2f9b787..9791ffa2 100644 --- a/Robust/src/Benchmarks/PERT/Tag/Stage.java +++ b/Robust/src/Benchmarks/PERT/Tag/Stage.java @@ -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"); } diff --git a/Robust/src/Benchmarks/TileSearch/Tag/GlobalCounter.java b/Robust/src/Benchmarks/TileSearch/Tag/GlobalCounter.java index 53e02583..68f853e6 100644 --- a/Robust/src/Benchmarks/TileSearch/Tag/GlobalCounter.java +++ b/Robust/src/Benchmarks/TileSearch/Tag/GlobalCounter.java @@ -1,8 +1,10 @@ public class GlobalCounter { flag Init; public int counter; + public boolean partial; public GlobalCounter() { counter = 0; + partial = false; } } diff --git a/Robust/src/Benchmarks/TileSearch/Tag/TileSearch.java b/Robust/src/Benchmarks/TileSearch/Tag/TileSearch.java index 686d68c8..ded343e1 100644 --- a/Robust/src/Benchmarks/TileSearch/Tag/TileSearch.java +++ b/Robust/src/Benchmarks/TileSearch/Tag/TileSearch.java @@ -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 {