Author: mrogers
Date: 2006-09-14 14:14:16 +0000 (Thu, 14 Sep 2006)
New Revision: 10472
Added:
trunk/apps/load-balancing-sims/phase6/messages/Search.java
Log:
CHK inserts, sorry about the large number of commits, I accidentally added
classfiles to the repository and I'm trying to fix it
Added: trunk/apps/load-balancing-sims/phase6/messages/Search.java
===================================================================
--- trunk/apps/load-balancing-sims/phase6/messages/Search.java 2006-09-14
14:14:13 UTC (rev 10471)
+++ trunk/apps/load-balancing-sims/phase6/messages/Search.java 2006-09-14
14:14:16 UTC (rev 10472)
@@ -0,0 +1,35 @@
+package messages;
+
+public class Search extends Message
+{
+ public final static int MAX_HTL = 5; // Maximum amount of backtracking
+
+ public final int key; // The target of the search
+ public double closest; // The closest location seen so far
+ public int htl; // Hops to live for backtracking
+
+ // Start a new search
+ public Search (int key, double location)
+ {
+ id = Message.nextId++;
+ this.key = key;
+ closest = location;
+ htl = MAX_HTL;
+ size = Message.HEADER_SIZE + Message.KEY_SIZE;
+ }
+
+ // Forward a search
+ public Search (int id, int key, double closest, int htl)
+ {
+ this.id = id;
+ this.key = key;
+ this.closest = closest;
+ this.htl = htl;
+ size = Message.HEADER_SIZE + Message.KEY_SIZE;
+ }
+
+ public String toString()
+ {
+ return new String ("search (" +id+ "," +key+ "," +htl+ ")");
+ }
+}