view src/alice/test/topology/aquarium/fx/TopNode.java @ 40:8119d2bc3735 default tip

refactor
author YU
date Mon, 09 Jun 2014 19:17:00 +0900
parents b77c2c6db854
children
line wrap: on
line source

package alice.test.topology.aquarium.fx;

import alice.codesegment.CodeSegment;
import alice.datasegment.CommandType;
import alice.datasegment.Receiver;

public class TopNode extends CodeSegment{

	private Receiver data1 = ids.create(CommandType.PEEK);
	private Receiver data2 = ids.create(CommandType.PEEK);
	
	public TopNode(){
		data1.setKey("width");
		data2.setKey("mynum");
	}
	
	@Override
	public void run() {
		ods.put("local", "list", new RoutingTable());
		new RegistRoutingTable();
		
		int startX = data1.asInteger() * data2.asInteger(); 
		ods.put("local", "startX", startX);
		ods.put("local", "CHILDNUM", 0);/* int id must no use */
		new CalculateMaxSize();
		new CountMessage();
		new Share("MAXSIZE");
		Aquarium aqua = new Aquarium();
		aqua.run();
	}

}