Mercurial > hg > Database > Alice
annotate src/alice/test/codesegment/local/TestCodeSegment.java @ 103:37f3483a869b working
remove bug from "CheckParentIndex" and "CheckLocalIndex"
author | sugi |
---|---|
date | Mon, 02 Jul 2012 11:16:01 +0900 |
parents | df786bf8f036 |
children | a8f77957a477 |
rev | line source |
---|---|
22
2ca2d961a8d2
implements outline of TopologyManager
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
1 package alice.test.codesegment.local; |
3 | 2 |
3 import alice.codesegment.CodeSegment; | |
18
72dd27d952b0
change InputDataSegment API
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
4 import alice.datasegment.CommandType; |
33
20c67f673224
change name of DataSegmentReceiver
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
5 import alice.datasegment.Receiver; |
97 | 6 import alice.test.topology.movement.FishPoint; |
3 | 7 |
8 public class TestCodeSegment extends CodeSegment { | |
9 | |
57 | 10 // create input datasegment arg1 |
33
20c67f673224
change name of DataSegmentReceiver
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
11 Receiver arg1 = ids.create(CommandType.PEEK); |
97 | 12 public TestCodeSegment(){ |
13 arg1.setKey("key1"); | |
14 } | |
15 public TestCodeSegment(int index){ | |
16 arg1.setKey("key1",index); | |
17 } | |
16 | 18 |
3 | 19 @Override |
20 public void run() { | |
18
72dd27d952b0
change InputDataSegment API
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
21 System.out.println("index = " + arg1.index); |
72dd27d952b0
change InputDataSegment API
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
22 System.out.println("data = " + arg1.val); |
103
37f3483a869b
remove bug from "CheckParentIndex" and "CheckLocalIndex"
sugi
parents:
97
diff
changeset
|
23 System.out.println("data = " + arg1.asClass(FishPoint.class)); |
18
72dd27d952b0
change InputDataSegment API
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
24 System.out.println(arg1.val.getType()); |
103
37f3483a869b
remove bug from "CheckParentIndex" and "CheckLocalIndex"
sugi
parents:
97
diff
changeset
|
25 /* |
97 | 26 FishPoint PD = this.arg1.asClass(FishPoint.class); |
27 | |
28 PD.setXY(PD.getX()+1,PD.getY()+1); | |
103
37f3483a869b
remove bug from "CheckParentIndex" and "CheckLocalIndex"
sugi
parents:
97
diff
changeset
|
29 */ |
18
72dd27d952b0
change InputDataSegment API
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
30 if (arg1.index == 10) { |
12 | 31 System.exit(0); |
32 return; | |
33 } | |
97 | 34 /* |
18
72dd27d952b0
change InputDataSegment API
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
35 TestCodeSegment cs = new TestCodeSegment(); |
71
a3a2605e16a2
change checking debug mode of logger
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
57
diff
changeset
|
36 cs.arg1.setKey("key1", arg1.index); |
97 | 37 */ |
38 new TestCodeSegment(arg1.index); | |
57 | 39 // DataSegment.get("local").update |
103
37f3483a869b
remove bug from "CheckParentIndex" and "CheckLocalIndex"
sugi
parents:
97
diff
changeset
|
40 ods.update("local", "key1", this.arg1.asClass(FishPoint.class)); |
3 | 41 } |
42 | |
43 } |