diff src/alice/test/topology/share/CheckMyName.java @ 103:37f3483a869b working

remove bug from "CheckParentIndex" and "CheckLocalIndex"
author sugi
date Mon, 02 Jul 2012 11:16:01 +0900
parents df786bf8f036
children a8f77957a477
line wrap: on
line diff
--- a/src/alice/test/topology/share/CheckMyName.java	Thu Jun 28 03:43:56 2012 +0900
+++ b/src/alice/test/topology/share/CheckMyName.java	Mon Jul 02 11:16:01 2012 +0900
@@ -6,11 +6,14 @@
 import alice.codesegment.CodeSegment;
 import alice.datasegment.CommandType;
 import alice.datasegment.Receiver;
+import alice.test.topology.movement.FishPoint;
 
 public class CheckMyName extends CodeSegment {
 	Receiver host = ids.create(CommandType.PEEK);
 	Pattern pattern = Pattern.compile("^(node|cli)([0-9]+)$");
 	
+	String key = "fish";
+	
 	public CheckMyName(){
 		host.setKey("local","host");
 	}
@@ -28,8 +31,9 @@
 		
 		if (type.equals("cli")){
 			System.out.println("cli"+cliNum);
-			ods.update("local", "fish", 0);
-			new RelayPoint("fish");
+			ods.update("local", this.key, new FishPoint(0.0f,0.0f));
+			new CheckLocalIndex(this.key,0);
+			new CheckParentIndex(this.key,0);
 			
 			
 									
@@ -37,19 +41,20 @@
 			
 			System.out.println("node"+cliNum);
 			if (cliNum == 0){
-				for (int i = 0; i < 20; i++) {
-					System.out.println("i = " + i);
-					ods.update("local", "fish", i);
-					try {
+				try {
+					for (float i = 0.0f; i < 2.0f; i +=0.1f) {
+						System.out.println("i = " + i);
+						ods.update("local", "fish", new FishPoint(i,i));
 						wait(500);
-					} catch (InterruptedException e) {
-						
-						e.printStackTrace();
-					}
+					} 
+				}catch (InterruptedException e) {
+					
+					e.printStackTrace();
 				}
 			}else{
-				ods.update("local", "fish", 0);
-				new RelayPoint("fish");
+				ods.update("local", this.key, new FishPoint(0.0f,0.0f));
+				new CheckLocalIndex(this.key,0);
+				new CheckParentIndex(this.key,0);
 				
 			}