view src/alice/test/codesegment/local/TestCodeSegment.java @ 150:206c7dd9cb48 working

remove version alpha beta
author sugi
date Tue, 27 Nov 2012 19:41:52 +0900
parents 53aff28cde6b
children 16418c2c3e72
line wrap: on
line source

package alice.test.codesegment.local;

import alice.codesegment.CodeSegment;
import alice.datasegment.CommandType;
import alice.datasegment.Receiver;
import alice.test.topology.aquarium.FishPoint;

public class TestCodeSegment extends CodeSegment {
	
	static int count = 0;
	
	// create input datasegment arg1
	Receiver arg1 = ids.create(CommandType.PEEK);
	public TestCodeSegment(){
		arg1.setKey("key1");
	}
	public TestCodeSegment(int index){
		arg1.setKey("key1",index);
	}
	
	@Override
	public void run() {
		FishPoint fp = this.arg1.asClass(FishPoint.class);
		//System.out.println("index = " + arg1.index);
		//System.out.println("data = " + arg1.val);
		//System.out.println(arg1.val.getType());
		
		
		if (arg1.index > 100000) {
			System.out.println(System.currentTimeMillis()-TestLocalAlice.t);
			System.exit(0);
			return;
		}
		/*
		TestCodeSegment cs = new TestCodeSegment();
		cs.arg1.setKey("key1", arg1.index);
		*/
		
		new TestCodeSegment(arg1.index);
		fp.setXYZ(fp.getX()+1.0f, fp.getY()+1.0f, fp.getZ()+1.0f);
		// DataSegment.get("local").update
		ods.update("local", "key1", fp);
		
	}

}