changeset 396:f64e53200228 multicast

root node send all object information to "registeredList" Key
author sugi
date Wed, 18 Jun 2014 15:33:14 +0900
parents 4d5d7721f78f
children ca92da166f1a
files .settings/org.eclipse.jdt.core.prefs src/main/java/alice/test/topology/aquarium/fx/CalculatePosition.java src/main/java/alice/test/topology/aquarium/fx/CreateObject.java src/main/java/alice/test/topology/aquarium/fx/ReceiveRegisterList.java
diffstat 4 files changed, 11 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/.settings/org.eclipse.jdt.core.prefs	Wed Jun 18 15:31:59 2014 +0900
+++ b/.settings/org.eclipse.jdt.core.prefs	Wed Jun 18 15:33:14 2014 +0900
@@ -1,5 +1,5 @@
 #
-#Tue Jun 17 16:10:29 JST 2014
+#Tue Jun 17 20:18:24 JST 2014
 org.eclipse.jdt.core.compiler.debug.localVariable=generate
 org.eclipse.jdt.core.compiler.compliance=1.8
 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
--- a/src/main/java/alice/test/topology/aquarium/fx/CalculatePosition.java	Wed Jun 18 15:31:59 2014 +0900
+++ b/src/main/java/alice/test/topology/aquarium/fx/CalculatePosition.java	Wed Jun 18 15:33:14 2014 +0900
@@ -11,7 +11,7 @@
 	private Receiver info2 = ids.create(CommandType.PEEK);
 	
 	public CalculatePosition(String key){
-		info.setKey(key+"FishdiffP");
+		info.setKey(key);
 		info1.setKey("OwnFishP");
 		info2.setKey("host");
 		
--- a/src/main/java/alice/test/topology/aquarium/fx/CreateObject.java	Wed Jun 18 15:31:59 2014 +0900
+++ b/src/main/java/alice/test/topology/aquarium/fx/CreateObject.java	Wed Jun 18 15:33:14 2014 +0900
@@ -40,7 +40,7 @@
 
 		// controlled own fish  
 		if (myName.equals(fishInfo.name)){
-			new CalculatePosition(fishInfo.name);
+			new CalculatePosition(fishInfo.name+"FishdiffP");
 		} 
 
 		new SetTranslate(fishInfo.name+"Fish");	
@@ -69,7 +69,6 @@
 	public void addColladaObject(Group obj){
 		ColModelImporter colImporter = new ColModelImporter();
 		colImporter.read(getClass().getClassLoader().getResource("objects/seymourplane-150-im.dae"));
-		System.out.println(colImporter.getImport().length);
 		Node[] node = colImporter.getImport();
 		obj.getChildren().add(node[0]);
 	}
--- a/src/main/java/alice/test/topology/aquarium/fx/ReceiveRegisterList.java	Wed Jun 18 15:31:59 2014 +0900
+++ b/src/main/java/alice/test/topology/aquarium/fx/ReceiveRegisterList.java	Wed Jun 18 15:33:14 2014 +0900
@@ -1,6 +1,6 @@
 package alice.test.topology.aquarium.fx;
 
-import java.util.ArrayList;
+import org.msgpack.type.Value;
 
 import alice.codesegment.CodeSegment;
 import alice.datasegment.CommandType;
@@ -12,14 +12,16 @@
 	public ReceiveRegisterList(){
 		info.setKey("registeredList");
 	}
-	
+
 	@Override
 	public void run() {
-		@SuppressWarnings("unchecked")
-		ArrayList<FishInfo> list = info.asClass(ArrayList.class);
-		for (FishInfo f :list){
-			System.out.println(f.name);
+		Value fishInfoList = info.asClass(Value.class);
+		System.out.println(fishInfoList.asArrayValue());
+		for (Value v : fishInfoList.asArrayValue()){
+			System.out.println(v);
 		}
+		
+		this.recycle();
 	}
 
 }