Mercurial > hg > Members > tatsuki > Alice
view src/alice/test/topology/ring/FirstRingMessagePassing.java @ 47:5b6624b2f055
delete stdout message of ring
author | kazz <kazz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 04 Feb 2012 16:05:14 +0900 |
parents | 1a498f436332 |
children | f60c0246c8ce |
line wrap: on
line source
package alice.test.topology.ring; import java.util.Date; import org.msgpack.type.ValueFactory; import alice.codesegment.CodeSegment; import alice.datasegment.CommandType; import alice.datasegment.Receiver; public class FirstRingMessagePassing extends CodeSegment { public Receiver counter = ids.create(CommandType.TAKE); private Date startTime; private int count; public FirstRingMessagePassing(Date startTime, int count) { this.startTime = startTime; this.count = count; } @Override public void run() { int counter = this.counter.asInteger(); ++counter; ods.put("right", "counter", counter); if (counter >= count) { ods.put("right", "finish", ValueFactory.createNilValue()); Date endTime = new Date(); long time = endTime.getTime() - startTime.getTime(); System.out.println(time); return; } FirstRingMessagePassing cs = new FirstRingMessagePassing(startTime, count); cs.counter.setKey("local", "counter"); } }