# HG changeset patch # User sugi # Date 1347952790 -32400 # Node ID f995396f2af733a669762235aef1eaa34928695a # Parent 87f1a30a8c822ad01462476c01e52a57ce6ddef4 remove bug diff -r 87f1a30a8c82 -r f995396f2af7 image/black.jpg Binary file image/black.jpg has changed diff -r 87f1a30a8c82 -r f995396f2af7 src/alice/test/topology/aquarium/AutoIncrement.java --- a/src/alice/test/topology/aquarium/AutoIncrement.java Tue Sep 18 11:46:38 2012 +0900 +++ b/src/alice/test/topology/aquarium/AutoIncrement.java Tue Sep 18 16:19:50 2012 +0900 @@ -20,7 +20,7 @@ @Override public void run() { - max = this.number.asInteger()*2+1+0.3f; + max = this.number.asInteger()*2-1+0.3f; FishPoint fp = this.position.asClass(FishPoint.class); if (fp.getX()+0.01>max){ fp.setXY(min, fp.getY()); diff -r 87f1a30a8c82 -r f995396f2af7 src/alice/test/topology/aquarium/CheckMyName.java --- a/src/alice/test/topology/aquarium/CheckMyName.java Tue Sep 18 11:46:38 2012 +0900 +++ b/src/alice/test/topology/aquarium/CheckMyName.java Tue Sep 18 16:19:50 2012 +0900 @@ -29,7 +29,7 @@ MakeFrame frame = new MakeFrame(name); RoutingTable routing = new RoutingTable(); - ods.put("local", "num", 0); + ods.put("local", "num", 1); if (type.equals("cli")){ System.out.println("cli"+num); @@ -38,14 +38,14 @@ new AddRoutingTable(routing,0); ods.put("parent", "member", name); - new MemberNum(); + new TakeMynum(); }else if (type.equals("node")){ System.out.println("node"+num); if (num != 0){ routing.table.add(new Routing("parent")); ods.put("parent", "member", name); - new MemberNum(); + new TakeMynum(); } ods.put("local", "list", routing); diff -r 87f1a30a8c82 -r f995396f2af7 src/alice/test/topology/aquarium/MemberNum.java --- a/src/alice/test/topology/aquarium/MemberNum.java Tue Sep 18 11:46:38 2012 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -package alice.test.topology.aquarium; - -import alice.codesegment.CodeSegment; -import alice.datasegment.CommandType; -import alice.datasegment.Receiver; - -public class MemberNum extends CodeSegment { - // this CodeSegment has bug - - private Receiver number = ids.create(CommandType.TAKE); - - public MemberNum(){ - this.number.setKey("parent", "num"); - } - - @Override - public void run() { - ods.update("parent", "num", this.number.asInteger()+1); - } - -} diff -r 87f1a30a8c82 -r f995396f2af7 src/alice/test/topology/aquarium/TakeMynum.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/alice/test/topology/aquarium/TakeMynum.java Tue Sep 18 16:19:50 2012 +0900 @@ -0,0 +1,28 @@ +package alice.test.topology.aquarium; + +import alice.codesegment.CodeSegment; +import alice.datasegment.CommandType; +import alice.datasegment.Receiver; + +public class TakeMynum extends CodeSegment { + // this CodeSegment has bug + + private Receiver mynum = ids.create(CommandType.TAKE); + + public TakeMynum(){ + this.mynum.setKey("local", "num"); + } + + public TakeMynum(int index){ + this.mynum.setKey("local", "num", index); + } + + @Override + public void run() { + new TakePnum(this.mynum); + ods.put("local", "num", 0); + new TakeMynum(this.mynum.index+1); + } + +} + diff -r 87f1a30a8c82 -r f995396f2af7 src/alice/test/topology/aquarium/TakePnum.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/alice/test/topology/aquarium/TakePnum.java Tue Sep 18 16:19:50 2012 +0900 @@ -0,0 +1,24 @@ +package alice.test.topology.aquarium; + +import alice.codesegment.CodeSegment; +import alice.datasegment.CommandType; +import alice.datasegment.Receiver; + +public class TakePnum extends CodeSegment { + // this CodeSegment has bug + + private Receiver pnum = ids.create(CommandType.TAKE); + private Receiver mynum; + + public TakePnum(Receiver data){ + this.pnum.setKey("parent", "num"); + this.mynum = data; + } + + @Override + public void run() { + ods.update("parent", "num", + this.pnum.asInteger()+this.mynum.asInteger()); + } + +}