Mercurial > hg > Database > Christie
changeset 272:b592fe1d4a4e default tip
create example Attendance
author | matac42 <matac@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 01 Jul 2021 20:41:07 +0900 |
parents | 7f4be5f204b3 |
children | |
files | src/test/java/christie/example/Attendance/CallCodeGear.java src/test/java/christie/example/Attendance/Command.java src/test/java/christie/example/Attendance/ReadAloud.java src/test/java/christie/example/Attendance/Submission.java src/test/java/christie/example/PrefixTree/StartPrefixTree.java src/test/java/christie/example/PrefixTree/sendOrDisplay.java |
diffstat | 6 files changed, 47 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/test/java/christie/example/Attendance/CallCodeGear.java Sat Jun 26 10:45:58 2021 +0900 +++ b/src/test/java/christie/example/Attendance/CallCodeGear.java Thu Jul 01 20:41:07 2021 +0900 @@ -10,9 +10,9 @@ @Override protected void run(CodeGearManager cgm) { -// put("ack", "true"); System.out.println(ack); - getDGM("studentA").put("start", 1); - cgm.setup(new CallCodeGear()); + getDGM("studentA").put("start", "hello"); + getDGM("student2").put("start", "yea"); + cgm.setup(new ReadAloud()); } }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/test/java/christie/example/Attendance/Command.java Thu Jul 01 20:41:07 2021 +0900 @@ -0,0 +1,23 @@ +package christie.example.Attendance; +import org.msgpack.annotation.Message; + +@Message +class Command { + public String name; + public String number; + + public Command () {} + + public Command(String name, String number) { + this.name = name; + this.number = number; + } + + @Override + public String toString() { + return "Command{" + + "name='" + name + '\'' + + ", number='" + number + + '}'; + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/test/java/christie/example/Attendance/ReadAloud.java Thu Jul 01 20:41:07 2021 +0900 @@ -0,0 +1,16 @@ +package christie.example.Attendance; + +import christie.annotation.Take; +import christie.codegear.CodeGear; +import christie.codegear.CodeGearManager; + +public class ReadAloud extends CodeGear { + @Take + Command cmd; + + @Override + protected void run(CodeGearManager cgm) { + System.out.println("teacher: " + cmd); + cgm.setup(new ReadAloud()); + } +}
--- a/src/test/java/christie/example/Attendance/Submission.java Sat Jun 26 10:45:58 2021 +0900 +++ b/src/test/java/christie/example/Attendance/Submission.java Thu Jul 01 20:41:07 2021 +0900 @@ -7,11 +7,12 @@ public class Submission extends CodeGear { @Take - int start; + String start; @Override protected void run(CodeGearManager cgm) { - System.out.println(start); + Command cmd = new Command("student", "1"); + getDGM("teacher").put("cmd", cmd); cgm.setup(new Submission()); } }
--- a/src/test/java/christie/example/PrefixTree/StartPrefixTree.java Sat Jun 26 10:45:58 2021 +0900 +++ b/src/test/java/christie/example/PrefixTree/StartPrefixTree.java Thu Jul 01 20:41:07 2021 +0900 @@ -29,7 +29,7 @@ "--managerHost", "localhost", "--localPort", String.valueOf(topologyNodePort + i), "--totalNodeNum", String.valueOf(nodeNum), - "--i", String.valueOf(i)}; + "--i", String.valueOf(i+1)}; PrefixNode.main(nodeArg);
--- a/src/test/java/christie/example/PrefixTree/sendOrDisplay.java Sat Jun 26 10:45:58 2021 +0900 +++ b/src/test/java/christie/example/PrefixTree/sendOrDisplay.java Thu Jul 01 20:41:07 2021 +0900 @@ -21,6 +21,7 @@ @Override protected void run(CodeGearManager cgm) { if(topoDG.getConnectionList().contains("parent")){ + System.out.println(num); put("parent", "pushedNum", num); }else{ System.out.println("total:" + num);