# HG changeset patch # User Shinji KONO # Date 1358158956 -32400 # Node ID abe00abb2fd8c7f97ad7163ccfc2fb99c0154934 # Parent 23d6a775a64320db446036d2c7f028e128fff10e# Parent 88cc33eeafa63e8d3675c4e31065e358701d5929 Merge with 88cc33eeafa63e8d3675c4e31065e358701d5929 diff -r 23d6a775a643 -r abe00abb2fd8 src/alice/test/topology/aquarium/AutoIncrement.java --- a/src/alice/test/topology/aquarium/AutoIncrement.java Mon Jan 14 19:21:13 2013 +0900 +++ b/src/alice/test/topology/aquarium/AutoIncrement.java Mon Jan 14 19:22:36 2013 +0900 @@ -14,7 +14,7 @@ public AutoIncrement(String key,int index){ this.key = key; - this.number.setKey("local","num"); + this.number.setKey("local","maxsize"); this.position.setKey("local", key,index); } diff -r 23d6a775a643 -r abe00abb2fd8 src/alice/test/topology/aquarium/CheckMyName.java --- a/src/alice/test/topology/aquarium/CheckMyName.java Mon Jan 14 19:21:13 2013 +0900 +++ b/src/alice/test/topology/aquarium/CheckMyName.java Mon Jan 14 19:22:36 2013 +0900 @@ -48,11 +48,14 @@ ods.put("parent", "member", name); new TakeMynum(); + } else { + new SendMaxsize(0); } ods.put("local", "list", routing); new AddRoutingTable(routing,0); } + new CheckLocalIndex("maxsize",0); ods.update("local", key, new FishPoint(-0.1f,-0.1f)); new SetLocation(new MakeObject(frame), key, 0, num); @@ -68,7 +71,7 @@ for (int i = 3; i < 6 ; i++){ key = "fish"+i; - if (num == 0) new AutoIncrement(key,0); + if (num == 1) new AutoIncrement(key,0); Random rnd = new Random(); int tmp = rnd.nextInt(3); int rand = tmp + 1; @@ -80,7 +83,7 @@ for (int i = 6; i < 9 ; i++){ key = "fish"+i; - if (num == 0) new AutoIncrement(key,0); + if (num == 2) new AutoIncrement(key,0); Random rnd = new Random(); int tmp = rnd.nextInt(3); int rand = tmp + 3; @@ -92,7 +95,7 @@ for (int i = 9; i < 12 ; i++){ key = "fish"+i; - if (num == 0) new AutoIncrement(key,0); + if (num == 3) new AutoIncrement(key,0); Random rnd = new Random(); int tmp = rnd.nextInt(3); @@ -103,5 +106,6 @@ new SetLocation(new MakeObject(frame), key, 0, num); new CheckLocalIndex(key,1); } + } } diff -r 23d6a775a643 -r abe00abb2fd8 src/alice/test/topology/aquarium/SendMaxsize.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/alice/test/topology/aquarium/SendMaxsize.java Mon Jan 14 19:22:36 2013 +0900 @@ -0,0 +1,22 @@ +package alice.test.topology.aquarium; + +import alice.codesegment.CodeSegment; +import alice.datasegment.CommandType; +import alice.datasegment.Receiver; + +public class SendMaxsize extends CodeSegment{ + + private Receiver max = ids.create(CommandType.PEEK); + + public SendMaxsize(int index){ + this.max.setKey("local", "num", index); + } + + @Override + public void run() { + int size = max.asInteger(); + ods.update("local","maxsize",size); + new SendMaxsize(this.max.index); + } + +}