Mercurial > hg > Database > Alice
view src/main/java/alice/test/topology/fish/AssignStartX.java @ 345:8f71c3e6f11d
Change directory structure Maven standard
author | sugi |
---|---|
date | Wed, 16 Apr 2014 18:26:07 +0900 |
parents | |
children | aefbe41fcf12 |
line wrap: on
line source
package alice.test.topology.fish; import alice.codesegment.CodeSegment; import alice.datasegment.CommandType; import alice.datasegment.Receiver; public class AssignStartX extends CodeSegment { public Receiver routing = ids.create(CommandType.PEEK); public int startX; public int index; public AssignStartX(int startX, int index) { this.startX = startX; this.index = index; } @Override public void run() { System.out.println("AssignStartX: " + startX); RoutingTable routing = this.routing.asClass(RoutingTable.class); int x = startX; System.out.println("RoutingTable: " + this.routing.getVal()); if (this.index >= this.routing.index) { AssignStartX cs = new AssignStartX(startX, index); cs.routing.setKey("local", "routing", this.routing.index); return; } for (Routing r : routing.table) { System.out.println(r.name); ods.update(r.name, "startX", x); System.out.println("Assign: " + r.name + ".startX = " + x); x += r.width; } PeekStartX cs = new PeekStartX(this.routing.index); cs.startX.setKey("local", "startX", this.index); } }