changes
authorjzhou <jzhou>
Fri, 5 Sep 2008 03:08:56 +0000 (03:08 +0000)
committerjzhou <jzhou>
Fri, 5 Sep 2008 03:08:56 +0000 (03:08 +0000)
Robust/src/Benchmarks/MMG/Java/Ghost.java
Robust/src/Benchmarks/MMG/Java/MMG.java
Robust/src/Benchmarks/MMG/Java/Pacman.java
Robust/src/Benchmarks/MMG/Nor/Ghost.java
Robust/src/Benchmarks/MMG/Nor/MMG.java
Robust/src/Benchmarks/MMG/Nor/Pacman.java
Robust/src/Benchmarks/MMG/Tag/Ghost.java
Robust/src/Benchmarks/MMG/Tag/MMG.java
Robust/src/Benchmarks/MMG/Tag/Pacman.java

index b842d306dd2544169fc148cf30b17769c6531442..833429835576f17a77a71e1c30914b7c67c19c25 100755 (executable)
@@ -322,8 +322,23 @@ public class Ghost {
     }
     
     public void doMove() {
-       this.m_locX += this.m_dx;
-       this.m_locY += this.m_dy;
+       if((this.m_dx == -1) && (this.m_locX == 0)) {
+           // go left and currently this.m_locX is 0
+           this.m_locX = this.m_map.m_nrofblocks - 1;
+       } else if((this.m_dx == 1) && (this.m_locX == this.m_map.m_nrofblocks - 1)) {
+           this.m_locX = 0;
+       } else {
+           this.m_locX += this.m_dx;
+       }
+
+       if((this.m_dy == -1) && (this.m_locY == 0)) {
+           // go up and currently this.m_locY is 0
+           this.m_locY = this.m_map.m_nrofblocks - 1;
+       } else if((this.m_dy == 1) && (this.m_locY == this.m_map.m_nrofblocks - 1)) {
+           this.m_locY = 0;
+       } else {
+           this.m_locY += this.m_dy;
+       }
        this.m_dx = 0;
        this.m_dy = 0;
        //System.printString("Ghost " + this.m_index + ": (" + this.m_locX + ", " + this.m_locY + ")\n");
index ebd3950dbcf24b688f13c2e44ec74d5f3698bb50..dd87c5ad8b06763e60d3b1aabf17d39fd4e64ebe 100755 (executable)
@@ -33,8 +33,8 @@ public class MMG {
            map.m_desY[i] = ty*(i%2);\r
            map.m_pacOriX[i] = pacman.m_locX;\r
            map.m_pacOriY[i] = pacman.m_locY;\r
-           map.m_leftLives[i] = map.m_leftLevels[i] = 60;\r
-           pacman.m_leftLives = pacman.m_leftLevels = 60;\r
+           map.m_leftLives[i] = map.m_leftLevels[i] = 20;\r
+           pacman.m_leftLives = pacman.m_leftLevels = 20;\r
            map.m_pacmen[i] = pacman;\r
            //System.printString("destination: " + map.desX[i] + "," + map.desY[i] + "\n");\r
        }\r
index 17034312badf41a238b12b41ae04b7629d5bfbd9..b849d106e427a4f360df6ac83be3b47dd98f9822 100755 (executable)
@@ -418,8 +418,23 @@ public class Pacman {
     }\r
     \r
     public void doMove() {\r
-       this.m_locX += this.m_dx;\r
-       this.m_locY += this.m_dy;\r
+       if((this.m_dx == -1) && (this.m_locX == 0)) {\r
+           // go left and currently this.m_locX is 0\r
+           this.m_locX = this.m_map.m_nrofblocks - 1;\r
+       } else if((this.m_dx == 1) && (this.m_locX == this.m_map.m_nrofblocks - 1)) {\r
+           this.m_locX = 0;\r
+       } else {\r
+           this.m_locX += this.m_dx;\r
+       }\r
+\r
+       if((this.m_dy == -1) && (this.m_locY == 0)) {\r
+           // go up and currently this.m_locY is 0\r
+           this.m_locY = this.m_map.m_nrofblocks - 1;\r
+       } else if((this.m_dy == 1) && (this.m_locY == this.m_map.m_nrofblocks - 1)) {\r
+           this.m_locY = 0;\r
+       } else {\r
+           this.m_locY += this.m_dy;\r
+       }\r
        this.m_dx = 0;\r
        this.m_dy = 0;\r
        //System.printString("Pacmen " + this.m_index + ": (" + this.m_locX + ", " + this.m_locY + ")\n");\r
index 8d0b19424e2ef6cc9cfe695b660d4c8cb7e086ba..acb8799104c0ac959117376e1679317a0beffd72 100755 (executable)
@@ -329,8 +329,23 @@ public class Ghost {
     }
     
     public void doMove() {
-       this.m_locX += this.m_dx;
-       this.m_locY += this.m_dy;
+       if((this.m_dx == -1) && (this.m_locX == 0)) {
+           // go left and currently this.m_locX is 0
+           this.m_locX = this.m_map.m_nrofblocks - 1;
+       } else if((this.m_dx == 1) && (this.m_locX == this.m_map.m_nrofblocks - 1)) {
+           this.m_locX = 0;
+       } else {
+           this.m_locX += this.m_dx;
+       }
+
+       if((this.m_dy == -1) && (this.m_locY == 0)) {
+           // go up and currently this.m_locY is 0
+           this.m_locY = this.m_map.m_nrofblocks - 1;
+       } else if((this.m_dy == 1) && (this.m_locY == this.m_map.m_nrofblocks - 1)) {
+           this.m_locY = 0;
+       } else {
+           this.m_locY += this.m_dy;
+       }
        this.m_dx = 0;
        this.m_dy = 0;
        //System.printString("Ghost " + this.m_index + ": (" + this.m_locX + ", " + this.m_locY + ")\n");
index 827b42cde79adccf29d5003f6cb730c9323d05c5..72b7340f80d289189724db14dd86b508aa841246 100755 (executable)
@@ -41,8 +41,8 @@ task initMap(Map map{init}) {
        map.m_desY[i] = ty*(i%2);
        map.m_pacOriX[i] = pacman.m_locX;
        map.m_pacOriY[i] = pacman.m_locY;
-       map.m_leftLives[i] = map.m_leftLevels[i] = 60;
-       pacman.m_leftLives = pacman.m_leftLevels = 60;
+       map.m_leftLives[i] = map.m_leftLevels[i] = 20;
+       pacman.m_leftLives = pacman.m_leftLevels = 20;
     }
     
     map.m_ghostcount = 0;
@@ -102,7 +102,6 @@ task updatePac(Map map{updatePac}, /*optional*/ Pacman p{update}) {
        //System.printString("Pacman " + p.m_index + ": (" + map.m_pacMenX[p.m_index] + "," + map.m_pacMenY[p.m_index] + ")\n");
        boolean death = map.check(p);
     /*} else {
-       map.m_deathcount++;
        map.m_paccount++;
     }*/
     
index 117914c0841db856bf09d8eb3f236cdd6bc998ca..82d9ab890fdbd39d94819c966d1bfbb9b5e5d719 100755 (executable)
@@ -421,8 +421,23 @@ public class Pacman {
     }
     
     public void doMove() {
-       this.m_locX += this.m_dx;
-       this.m_locY += this.m_dy;
+       if((this.m_dx == -1) && (this.m_locX == 0)) {
+           // go left and currently this.m_locX is 0
+           this.m_locX = this.m_map.m_nrofblocks - 1;
+       } else if((this.m_dx == 1) && (this.m_locX == this.m_map.m_nrofblocks - 1)) {
+           this.m_locX = 0;
+       } else {
+           this.m_locX += this.m_dx;
+       }
+
+       if((this.m_dy == -1) && (this.m_locY == 0)) {
+           // go up and currently this.m_locY is 0
+           this.m_locY = this.m_map.m_nrofblocks - 1;
+       } else if((this.m_dy == 1) && (this.m_locY == this.m_map.m_nrofblocks - 1)) {
+           this.m_locY = 0;
+       } else {
+           this.m_locY += this.m_dy;
+       }
        this.m_dx = 0;
        this.m_dy = 0;
        //System.printString("Pacmen " + this.m_index + ": (" + this.m_locX + ", " + this.m_locY + ")\n");
index 1f6e4e54e810742c952f9df5c6e84aedd6b9f061..802d9efd5ea077c4c4d525bd51e264dc70f98200 100755 (executable)
@@ -339,8 +339,23 @@ public class Ghost {
     }
     
     public void doMove() {
-       this.m_locX += this.m_dx;
-       this.m_locY += this.m_dy;
+       if((this.m_dx == -1) && (this.m_locX == 0)) {
+           // go left and currently this.m_locX is 0
+           this.m_locX = this.m_map.m_nrofblocks - 1;
+       } else if((this.m_dx == 1) && (this.m_locX == this.m_map.m_nrofblocks - 1)) {
+           this.m_locX = 0;
+       } else {
+           this.m_locX += this.m_dx;
+       }
+
+       if((this.m_dy == -1) && (this.m_locY == 0)) {
+           // go up and currently this.m_locY is 0
+           this.m_locY = this.m_map.m_nrofblocks - 1;
+       } else if((this.m_dy == 1) && (this.m_locY == this.m_map.m_nrofblocks - 1)) {
+           this.m_locY = 0;
+       } else {
+           this.m_locY += this.m_dy;
+       }
        this.m_dx = 0;
        this.m_dy = 0;
        //System.printString("Ghost " + this.m_index + ": (" + this.m_locX + ", " + this.m_locY + ")\n");
index 1b2adf6810e951fce958e6372f1485c4d31bb420..19f93e8456f96aa9772f5ef4e7c12daf2cc22bc6 100755 (executable)
@@ -31,8 +31,8 @@ task initMap(Map map{init}) {
          map.m_desY[i] = ty*(i%2);
          map.m_pacOriX[i] = pacman.m_locX;
          map.m_pacOriY[i] = pacman.m_locY;
-         map.m_leftLives[i] = map.m_leftLevels[i] = 60;
-         pacman.m_leftLives = pacman.m_leftLevels = 60;
+         map.m_leftLives[i] = map.m_leftLevels[i] = 20;
+         pacman.m_leftLives = pacman.m_leftLevels = 20;
          //map.m_destinationX[i] = pacman.m_locX;
          //map.m_destinationY[i] = pacman.m_locY;
     }
@@ -91,7 +91,6 @@ task updatePac(Map map{updatePac}, optional Pacman p{update}) {
        //System.printString("Pacman " + p.m_index + ": (" + map.m_pacMenX[p.m_index] + "," + map.m_pacMenY[p.m_index] + ")\n");
        boolean death = map.check(p);
     } else {
-       map.m_deathcount++;
        map.m_paccount++;
     }
     
index 117914c0841db856bf09d8eb3f236cdd6bc998ca..82d9ab890fdbd39d94819c966d1bfbb9b5e5d719 100755 (executable)
@@ -421,8 +421,23 @@ public class Pacman {
     }
     
     public void doMove() {
-       this.m_locX += this.m_dx;
-       this.m_locY += this.m_dy;
+       if((this.m_dx == -1) && (this.m_locX == 0)) {
+           // go left and currently this.m_locX is 0
+           this.m_locX = this.m_map.m_nrofblocks - 1;
+       } else if((this.m_dx == 1) && (this.m_locX == this.m_map.m_nrofblocks - 1)) {
+           this.m_locX = 0;
+       } else {
+           this.m_locX += this.m_dx;
+       }
+
+       if((this.m_dy == -1) && (this.m_locY == 0)) {
+           // go up and currently this.m_locY is 0
+           this.m_locY = this.m_map.m_nrofblocks - 1;
+       } else if((this.m_dy == 1) && (this.m_locY == this.m_map.m_nrofblocks - 1)) {
+           this.m_locY = 0;
+       } else {
+           this.m_locY += this.m_dy;
+       }
        this.m_dx = 0;
        this.m_dy = 0;
        //System.printString("Pacmen " + this.m_index + ": (" + this.m_locX + ", " + this.m_locY + ")\n");