diff src/alice/test/topology/fishmodel/alpha/AutoIncrement.java @ 119:f84e1684c6be working

put NULL in CS
author sugi
date Thu, 26 Jul 2012 15:43:57 +0900
parents 248064474909
children 669dba7cbb69
line wrap: on
line diff
--- a/src/alice/test/topology/fishmodel/alpha/AutoIncrement.java	Sat Jul 21 11:22:20 2012 +0900
+++ b/src/alice/test/topology/fishmodel/alpha/AutoIncrement.java	Thu Jul 26 15:43:57 2012 +0900
@@ -8,6 +8,9 @@
 	
 	public Receiver position = ids.create(CommandType.PEEK);	
 	String key;
+	float max = 3.3f;
+	float min = -1.3f;
+	
 	
 	public AutoIncrement(String key,int index){
 		
@@ -15,15 +18,21 @@
 		this.position.setKey("local", key);
 		
 	}
+	
+	public void Init(){
+		this.ods = null;
+		this.position = null;
+		
+	}
 
 	@Override
 	public synchronized void run() {
 		FishPoint FP = this.position.asClass(FishPoint.class);
 		
-		if (FP.getX()+0.01>9.0f){
-			FP.setXY(-1.0f, FP.getY());
-		} else if (FP.getX()+0.01< -1.0f){
-			FP.setXY(9.0f, FP.getY());
+		if (FP.getX()+0.01>max){
+			FP.setXY(min, FP.getY());
+		} else if (FP.getX()+0.01< min){
+			FP.setXY(max, FP.getY());
 		}
 		else {
 			FP.setXY(FP.getX()+0.01f, FP.getY());
@@ -31,16 +40,17 @@
 		
 		
 		ods.update("local", key, FP);
-		
+		/*
 		try {
 			wait(200);
 		} catch (InterruptedException e) {
 			// TODO Auto-generated catch block
 			e.printStackTrace();
 		}
-		
+		*/
 		new AutoIncrement(this.key,this.position.index);
-		
+		//Init();
+		//java.lang.System.gc();
 	}
 	
 }