Mercurial > hg > Database > Alice
changeset 90:75aa139d46eb working
minor change
author | sugi |
---|---|
date | Tue, 05 Jun 2012 00:26:13 +0900 |
parents | e269cedd8bae |
children | 19f3bd33277d |
files | src/alice/test/topology/movement/checkLocation.java |
diffstat | 1 files changed, 0 insertions(+), 53 deletions(-) [+] |
line wrap: on
line diff
--- a/src/alice/test/topology/movement/checkLocation.java Tue Jun 05 00:01:27 2012 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -package alice.test.topology.movement; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import alice.codesegment.CodeSegment; -import alice.datasegment.CommandType; -import alice.datasegment.Receiver; - - -public class checkLocation extends CodeSegment{ - - public Receiver nowX = ids.create(CommandType.PEEK); - public Receiver host = ids.create(CommandType.PEEK); - MakeFrame frame; - MakeObject obj; - Pattern pattern = Pattern.compile("^(cli)([0-9]+)$"); - String myKey; - - public checkLocation(MakeObject MO ,String str){ - this.obj = MO; - this.myKey = str; - } - - @Override - public void run(){ - String name = host.asString(); - Matcher matcher = pattern.matcher(name); - matcher.find(); - int num = new Integer(matcher.group(2)); - - float startX = 2*num - 3.0f; - float endX = 2*num -0.9f; - float x = (float)this.nowX.asInteger()/1000; - System.out.println(myKey+": " + x); - if (startX <= x && x < endX){ - obj.setLocation(x - 2*(num-1), 0.1f*num); - ods.update("parent", myKey, this.nowX.asInteger()+1); - } - - - checkLocation cs = new checkLocation(this.obj,this.myKey); - cs.nowX.setKey("parent",myKey); - cs.host.setKey("local","host"); - - - - - - } - - -}