changeset 262:ba55adb8a042

fixed bug
author sugi
date Tue, 23 Jul 2013 14:13:14 +0900
parents 7e1f6b575b5a
children 106cc1cfa595
files src/alice/test/topology/aquarium/CheckMyName.java src/alice/test/topology/aquarium/RefreshWindow.java src/alice/test/topology/aquarium/SetLocation.java
diffstat 3 files changed, 12 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/alice/test/topology/aquarium/CheckMyName.java	Tue Jul 16 16:17:31 2013 +0900
+++ b/src/alice/test/topology/aquarium/CheckMyName.java	Tue Jul 23 14:13:14 2013 +0900
@@ -44,14 +44,14 @@
 		new CheckLocalIndex("maxsize",0);
 		
 		ods.update(key, new FishPoint(-0.1f,-0.1f));
-		new SetLocation(new MakeObject(frame), key, 0, num);
+		new SetLocation(new MakeObject(frame), key, 0);
 		new CheckLocalIndex(key,1);
 		for (int i = 0; i < 3 ; i++){
 			key = "fish"+i;
 			if (num == 0) new AutoIncrement(key,0);
 			ods.update(key, new FishPoint((float)Math.random(),
 					(float)Math.random(), (float)Math.random()));
-			new SetLocation(new MakeObject(frame), key, 0, num);
+			new SetLocation(new MakeObject(frame), key, 0);
 			new CheckLocalIndex(key,1);
 		}
 		
@@ -63,7 +63,7 @@
 			int rand = tmp + 1;
 			ods.update(key, new FishPoint( (float)rand, 
 					-(float)Math.random(), -(float)Math.random()));
-			new SetLocation(new MakeObject(frame), key, 0, num);
+			new SetLocation(new MakeObject(frame), key, 0);
 			new CheckLocalIndex(key,1);
 		}
 		
@@ -75,7 +75,7 @@
 			int rand = tmp + 3;
 			ods.update(key, new FishPoint( (float)rand, 
 					(float)Math.random(), -(float)Math.random()));
-			new SetLocation(new MakeObject(frame), key, 0, num);
+			new SetLocation(new MakeObject(frame), key, 0);
 			new CheckLocalIndex(key,1);
 		}
 		
@@ -89,7 +89,7 @@
 			
 			ods.update(key, new FishPoint( (float)rand, 
 					-(float)Math.random(), (float)Math.random()));
-			new SetLocation(new MakeObject(frame), key, 0, num);
+			new SetLocation(new MakeObject(frame), key, 0);
 			new CheckLocalIndex(key,1);
 		}
 		
--- a/src/alice/test/topology/aquarium/RefreshWindow.java	Tue Jul 16 16:17:31 2013 +0900
+++ b/src/alice/test/topology/aquarium/RefreshWindow.java	Tue Jul 23 14:13:14 2013 +0900
@@ -4,22 +4,23 @@
 import alice.datasegment.Receiver;
 
 public class RefreshWindow extends CodeSegment {
+	private Receiver num = ids.create(CommandType.PEEK);
 	private Receiver host = ids.create(CommandType.PEEK);
 	private MakeFrame frame;
 	
 	public RefreshWindow(MakeFrame frame){
-		this.host.setKey("host_num");
+		this.host.setKey("host");
+		this.num.setKey("host_num");
 		this.frame = frame;
 	}
 	
 	@Override
 	public void run() {
-		
 		frame.getJFrame().dispose();
 		ObjectList list = frame.getList();
-		frame = new MakeFrame(this.host.asString(),host.asInteger());
+		frame = new MakeFrame(host.asString(),num.asInteger());
 		for (MakeObject obj : list.table) {
-			this.frame.register(obj);
+			frame.register(obj);
 		}
 	}
 
--- a/src/alice/test/topology/aquarium/SetLocation.java	Tue Jul 16 16:17:31 2013 +0900
+++ b/src/alice/test/topology/aquarium/SetLocation.java	Tue Jul 23 14:13:14 2013 +0900
@@ -9,11 +9,9 @@
 	
 	private Receiver position = ids.create(CommandType.PEEK);
 	private MakeObject obj;
-	private int range; // should be DS
 	
-	public SetLocation(MakeObject obj ,String key, int index, int range){
+	public SetLocation(MakeObject obj ,String key, int index){
 		this.obj = obj;
-		this.range = range;
 		this.position.setKey(key,index);
 	}
 	
@@ -21,7 +19,7 @@
 	public void run(){
 		FishPoint fp = this.position.asClass(FishPoint.class);
 		obj.setLocation(fp.getX(), fp.getY(), fp.getZ());
-		new SetLocation(obj, position.key, position.index, range);
+		new SetLocation(obj, position.key, position.index);
 					
 	}