Mercurial > hg > Database > Alice
diff src/alice/test/topology/movement/CheckFishLocation.java @ 105:993a9f194615 working
success share TEST
author | sugi |
---|---|
date | Tue, 03 Jul 2012 15:58:08 +0900 |
parents | df786bf8f036 |
children |
line wrap: on
line diff
--- a/src/alice/test/topology/movement/CheckFishLocation.java Tue Jul 03 15:55:27 2012 +0900 +++ b/src/alice/test/topology/movement/CheckFishLocation.java Tue Jul 03 15:58:08 2012 +0900 @@ -13,13 +13,14 @@ private Receiver position = ids.create(CommandType.PEEK); private Receiver host = ids.create(CommandType.PEEK); MakeObject obj; + String key; Pattern pattern = Pattern.compile("^(cli)([0-9]+)$"); - public CheckFishLocation(MakeObject MO ,String str){ + public CheckFishLocation(MakeObject MO ,String key,int index){ this.obj = MO; - this.position.key = str; + this.key = key; this.host.setKey("local","host"); - this.position.setKey("parent",this.position.key,this.position.index); + this.position.setKey("local",key,index); } @Override @@ -32,15 +33,15 @@ float startX = 2*num - 3.0f; float endX = 2*num -0.9f; FishPoint FP = this.position.asClass(FishPoint.class); - System.out.println(this.position.key+" :" + FP.getX()); - + obj.setLocation(FP.getX(), FP.getY()); + /* if (startX <= FP.getX() && FP.getX() < endX){ obj.setLocation(FP.getX() - 2*(num-1), FP.getY()); - //if(this.position.key!="fish3X") - //ods.update("parent", this.position.key, this.position.asInteger()+1); + if(this.position.key!="fish3X") + ods.update("parent", this.position.key, this.position.asInteger()+1); } - - new CheckFishLocation(this.obj,this.position.key); + */ + new CheckFishLocation(this.obj,this.key,this.position.index);