Mercurial > hg > Members > tatsuki > Alice
diff src/alice/test/topology/fishmodel/alpha/AutoIncrement.java @ 115:9845b74063ec working
share max number
author | sugi |
---|---|
date | Sat, 21 Jul 2012 10:02:41 +0900 |
parents | 7dbaaa0de144 |
children | 248064474909 |
line wrap: on
line diff
--- a/src/alice/test/topology/fishmodel/alpha/AutoIncrement.java Wed Jul 18 20:40:50 2012 +0900 +++ b/src/alice/test/topology/fishmodel/alpha/AutoIncrement.java Sat Jul 21 10:02:41 2012 +0900 @@ -17,11 +17,28 @@ } @Override - public void run() { + public synchronized void run() { FishPoint FP = this.position.asClass(FishPoint.class); - FP.setXY(FP.getX()+0.01f, FP.getY()); + + if (FP.getX()+0.01>9.0f){ + FP.setXY(-1.0f, FP.getY()); + } else if (FP.getX()+0.01< -1.0f){ + FP.setXY(9.0f, FP.getY()); + } + else { + FP.setXY(FP.getX()+0.01f, FP.getY()); + } + + ods.update("local", key, FP); + try { + wait(150); + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + new AutoIncrement(this.key,this.position.index); }