changeset 178:1b532146b355 working

minor change
author e095732
date Sun, 03 Feb 2013 18:20:46 +0900
parents 4a6412b9d9aa
children 8d3cb7e5fa57
files src/alice/test/topology/aquarium/AddRoutingTable.java src/alice/test/topology/aquarium/AutoIncrement.java src/alice/test/topology/aquarium/CheckLocalIndex.java src/alice/test/topology/aquarium/SetLocation.java
diffstat 4 files changed, 14 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/src/alice/test/topology/aquarium/AddRoutingTable.java	Tue Jan 29 15:25:22 2013 +0900
+++ b/src/alice/test/topology/aquarium/AddRoutingTable.java	Sun Feb 03 18:20:46 2013 +0900
@@ -7,11 +7,11 @@
 public class AddRoutingTable extends CodeSegment {
 	
 	public Receiver mail = ids.create(CommandType.PEEK);
-	RoutingTable routing;
+	private RoutingTable routing;
 	
 	public AddRoutingTable(RoutingTable routing,int index){
 		this.routing = routing;
-		this.mail.setKey("local", "member",index);
+		this.mail.setKey("local", "member", index);
 		
 	}
 
@@ -21,7 +21,7 @@
 		routing.table.add(new Routing(this.mail.from));
 		
 		ods.update("local", "list", this.routing);
-		new AddRoutingTable(this.routing,this.mail.index);
+		new AddRoutingTable(this.routing, this.mail.index);
 		
 	}
 	
--- a/src/alice/test/topology/aquarium/AutoIncrement.java	Tue Jan 29 15:25:22 2013 +0900
+++ b/src/alice/test/topology/aquarium/AutoIncrement.java	Sun Feb 03 18:20:46 2013 +0900
@@ -8,14 +8,12 @@
 	
 	private Receiver position = ids.create(CommandType.PEEK);
 	private Receiver number = ids.create(CommandType.PEEK);
-	private String key;
 	private float min = -1.3f;
 	private float max;
 	
 	public AutoIncrement(String key,int index){
-		this.key = key;
-		this.number.setKey("local","maxsize");
-		this.position.setKey("local", key,index);
+		this.number.setKey("local", "maxsize");
+		this.position.setKey("local", key, index);
 	}
 
 	@Override
@@ -31,7 +29,7 @@
 			fp.setXYZ(fp.getX()+0.01f, fp.getY(), fp.getZ());
 		}
 		
-		ods.update("local", key, fp);
+		ods.update("local", position.key, fp);
 		synchronized(this){
 			try {
 				// TODO
@@ -44,7 +42,7 @@
 			}
 		}
 		
-		new AutoIncrement(this.key,this.position.index);
+		new AutoIncrement(this.position.key, this.position.index);
 	}
 	
 }
--- a/src/alice/test/topology/aquarium/CheckLocalIndex.java	Tue Jan 29 15:25:22 2013 +0900
+++ b/src/alice/test/topology/aquarium/CheckLocalIndex.java	Sun Feb 03 18:20:46 2013 +0900
@@ -8,12 +8,11 @@
 
 	private Receiver data = ids.create(CommandType.PEEK);
 	private Receiver list = ids.create(CommandType.PEEK);
-	private String key;
 	
 	public CheckLocalIndex(String key, int index){
-		this.key = key;
+		
 		this.list.setKey("local", "list");
-		this.data.setKey("local", this.key, index);
+		this.data.setKey("local", key, index);
 	}
 	
 	@Override
@@ -21,11 +20,11 @@
 		RoutingTable rt = this.list.asClass(RoutingTable.class);
 		for (Routing r : rt.table) {
 			if (!r.name.equals(this.data.from)){
-				ods.update(r.name, this.key, this.data.val);
+				ods.update(r.name, data.key, this.data.val);
 			}
 			
 		}
-		new CheckLocalIndex(this.key, this.data.index);
+		new CheckLocalIndex(data.key, this.data.index);
 		
 	}
 
--- a/src/alice/test/topology/aquarium/SetLocation.java	Tue Jan 29 15:25:22 2013 +0900
+++ b/src/alice/test/topology/aquarium/SetLocation.java	Sun Feb 03 18:20:46 2013 +0900
@@ -9,12 +9,10 @@
 	
 	private Receiver position = ids.create(CommandType.PEEK);
 	private MakeObject obj;
-	private String key;
-	int range;
+	private int range; // should be DS
 	
-	public SetLocation(MakeObject obj ,String key,int index,int range){
+	public SetLocation(MakeObject obj ,String key, int index, int range){
 		this.obj = obj;
-		this.key = key;
 		this.range = range;
 		this.position.setKey("local",key,index);
 	}
@@ -23,7 +21,7 @@
 	public void run(){
 		FishPoint fp = this.position.asClass(FishPoint.class);
 		obj.setLocation(fp.getX(), fp.getY(), fp.getZ());
-		new SetLocation(this.obj, this.key, this.position.index, this.range);
+		new SetLocation(obj, position.key, position.index, range);
 					
 	}