Mercurial > hg > Members > nobuyasu > Alice > DPPAlice
changeset 2:cd80e302a3c4
modified
author | one |
---|---|
date | Sun, 25 Nov 2012 02:37:45 +0900 |
parents | 0c4412f878d5 |
children | 6b3f0f87a36b |
files | src/alice/test/dpp/codesegment/DPPTestAlice.java src/alice/test/dpp/codesegment/StartCodeSegment.java src/alice/test/dpp/model/Philosophy.java src/codesegment/DPPTestAlice.java src/codesegment/PhilosophyCodeSegment.java src/codesegment/StartCodeSegment.java |
diffstat | 6 files changed, 64 insertions(+), 75 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/alice/test/dpp/codesegment/DPPTestAlice.java Sun Nov 25 02:37:45 2012 +0900 @@ -0,0 +1,14 @@ +package alice.test.dpp.codesegment; + +public class DPPTestAlice { + + public static void main(String[] args) { + System.out.println("Start DPPTestAlice"); + + new StartCodeSegment().execute(); + + + } + + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/alice/test/dpp/codesegment/StartCodeSegment.java Sun Nov 25 02:37:45 2012 +0900 @@ -0,0 +1,19 @@ +package alice.test.dpp.codesegment; + +import alice.codesegment.CodeSegment; +import alice.test.dpp.model.Philosophy; + +public class StartCodeSegment extends CodeSegment { + + @Override + public void run() { + System.out.println("run StartCodeSegment"); + new ThinkCodeSegment(new Philosophy("phil1","fork1","fork2")); + ods.update("local", "fork1", 1); + ods.update("local", "fork2", 2); +// ods.update("local", "fork3", 3); +// ods.update("local", "fork4", 4); +// ods.update("local", "fork4", 4); + } + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/alice/test/dpp/model/Philosophy.java Sun Nov 25 02:37:45 2012 +0900 @@ -0,0 +1,31 @@ +package alice.test.dpp.model; + +public class Philosophy { + + private final String name, leftFork, rightFork; + + public Philosophy(String n,String lFork, String rFork) { + name = n; + leftFork = lFork; + rightFork = rFork; + } + + public Philosophy(Philosophy p) { + name = p.getName(); + leftFork = p.getLeftFork(); + rightFork = p.getRightFork(); + } + + public String getName() { + return name; + } + + public String getLeftFork() { + return leftFork; + } + + public String getRightFork() { + return rightFork; + } + +}
--- a/src/codesegment/DPPTestAlice.java Thu Nov 22 16:40:37 2012 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -package codesegment; - -public class DPPTestAlice { - - public static void main(String[] args) { - System.out.println("Start DPPTestAlice"); - - new StartCodeSegment().execute(); - - - } - - -}
--- a/src/codesegment/PhilosophyCodeSegment.java Thu Nov 22 16:40:37 2012 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -package codesegment; - -import alice.codesegment.CodeSegment; -import alice.datasegment.CommandType; -import alice.datasegment.Receiver; - -public class PhilosophyCodeSegment extends CodeSegment { - - private final String name, leftFork, rightFork; - Receiver arg1 = ids.create(CommandType.TAKE); - Receiver arg2 = ids.create(CommandType.TAKE); - - public PhilosophyCodeSegment(String n,String lFork, String rFork) { - name = n; - leftFork = lFork; - rightFork = rFork; - arg1.setKey(leftFork); - arg2.setKey(rightFork); - } - - public String getName() { - return name; - } - - public String getLeftFork() { - return leftFork; - } - - public String getRightFork() { - return rightFork; - } - - @Override - public void run() { - - - - - } - - - -}
--- a/src/codesegment/StartCodeSegment.java Thu Nov 22 16:40:37 2012 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -package codesegment; - -import alice.codesegment.CodeSegment; - -public class StartCodeSegment extends CodeSegment { - - @Override - public void run() { - System.out.println("run StartCodeSegment"); - new PhilosophyCodeSegment("phil1","fork1","fork2"); - ods.update("local", "fork1", 1); - ods.update("local", "fork2", 2); -// ods.update("local", "fork3", 3); -// ods.update("local", "fork4", 4); -// ods.update("local", "fork4", 4); - } - -}