Mercurial > hg > Members > nobuyasu > Alice > DPPAlice
changeset 31:b815328a8d42 draft
modified TakeForkCodeSegment
author | one |
---|---|
date | Tue, 29 Jan 2013 17:31:01 +0900 |
parents | 5eb22e2f7169 |
children | b4a700fd1bd8 |
files | src/alice/test/dpp/codesegment/philosophy/TakeForkCodeSegment.java |
diffstat | 1 files changed, 7 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/alice/test/dpp/codesegment/philosophy/TakeForkCodeSegment.java Tue Jan 29 17:17:44 2013 +0900 +++ b/src/alice/test/dpp/codesegment/philosophy/TakeForkCodeSegment.java Tue Jan 29 17:31:01 2013 +0900 @@ -8,9 +8,6 @@ public class TakeForkCodeSegment extends CodeSegment { - /* - * Unuse CodeSegment - */ Receiver arg1 = ids.create(CommandType.TAKE); Receiver arg2 = ids.create(CommandType.TAKE); Receiver arg3 = ids.create(CommandType.TAKE); @@ -28,6 +25,11 @@ Fork rightFork = arg2.asClass(Fork.class); Fork leftFork = arg3.asClass(Fork.class); System.out.println(phil.getName() + " is trying to take the fork."); + new EatCodeSegment(phil.getName()); + ods.update("local", phil.getName(), phil); + ods.update("local", leftFork.getForkName(), leftFork); + ods.update("local", rightFork.getForkName(), rightFork); +/* if (leftFork.takeFork(phil.getName()) && rightFork.takeFork(phil.getName()) ) { phil.setState(Philosophy.State.EAT); new EatCodeSegment(phil.getName()); @@ -36,8 +38,7 @@ // rightFork.onTheTable(phil.getName()); new TakeForkCodeSegment(phil.getName(), phil.getRightFork(), phil.getLeftFork()); } - ods.update("local", phil.getName(), phil); - ods.update("local", leftFork.getForkName(), leftFork); - ods.update("local", rightFork.getForkName(), rightFork); +*/ + } }