[Tinyos-contrib-commits] CVS: tinyos-1.x/contrib/wustl/tools/java/edu/wustl/mobilab/directory ExperimentDataCollector.java, 1.6, 1.7 TraceAnalyser.java, 1.6, 1.7

Chien-Liang Fok chien-liang at users.sourceforge.net
Sat Apr 8 14:28:30 PDT 2006


Update of /cvsroot/tinyos/tinyos-1.x/contrib/wustl/tools/java/edu/wustl/mobilab/directory
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4335/edu/wustl/mobilab/directory

Modified Files:
	ExperimentDataCollector.java TraceAnalyser.java 
Log Message:


Index: ExperimentDataCollector.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/tools/java/edu/wustl/mobilab/directory/ExperimentDataCollector.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** ExperimentDataCollector.java	8 Apr 2006 16:43:52 -0000	1.6
--- ExperimentDataCollector.java	8 Apr 2006 21:28:26 -0000	1.7
***************
*** 19,25 ****
  public class ExperimentDataCollector implements AgillaConstants {
  	public static final int AGENT_MOVED   = 0;
! 	public static final int QUERY_ISSUED  = 1;
! 	public static final int QUERY_RESULTS_RECEIVED = 2;
! 	public static final int SET_CLUSTER_HEAD = 3;
  	
  	public static final int MAX_NUM_QUERIES = 100;  // how many queries to wait for before stopping experiment
--- 19,28 ----
  public class ExperimentDataCollector implements AgillaConstants {
  	public static final int AGENT_MOVED   = 0;
! 	public static final int QUERY_GET_LOCATION_ISSUED  = 1;
! 	public static final int QUERY_GET_LOCATION_RESULTS_RECEIVED = 2;
! 	public static final int QUERY_GET_LOCATION_FORWARDED = 3;
! 	public static final int QUERY_GET_LOCATION_RESULTS_FORWARDED = 4;
! 	public static final int SET_CLUSTER_HEAD = 5;
! 	public static final int AGENT_MIGRATING = 6;
  	
  	public static final int MAX_NUM_QUERIES = 100;  // how many queries to wait for before stopping experiment
***************
*** 113,122 ****
  			case AGENT_MOVED:
  				return "AGENT_MOVED";
! 			case QUERY_ISSUED:
! 				return "QUERY_ISSUED";
! 			case QUERY_RESULTS_RECEIVED:
! 				return "QUERY_RESULTS_RECEIVED";
  			case SET_CLUSTER_HEAD:
  				return "SET_CLUSTER_HEAD";
  			}
  			return "UNKNOWN";
--- 116,131 ----
  			case AGENT_MOVED:
  				return "AGENT_MOVED";
! 			case QUERY_GET_LOCATION_ISSUED:
! 				return "QUERY_GET_LOCATION_ISSUED";
! 			case QUERY_GET_LOCATION_RESULTS_RECEIVED:
! 				return "QUERY_GET_LOCATION_RESULTS_RECEIVED";
! 			case QUERY_GET_LOCATION_FORWARDED :
! 				return "QUERY_GET_LOCATION_FORWARDED";
! 			case QUERY_GET_LOCATION_RESULTS_FORWARDED:
! 				return "QUERY_GET_LOCATION_RESULTS_FORWARDED";
  			case SET_CLUSTER_HEAD:
  				return "SET_CLUSTER_HEAD";
+ 			case AGENT_MIGRATING:
+ 				return "AGENT_MIGRATING";				
  			}
  			return "UNKNOWN";
***************
*** 127,135 ****
  			System.out.println("TRACE: " + trace.get_agentID() + " " + trace.get_nodeID() + " "
  					+ trace.get_timestamp_high32() + "" + trace.get_timestamp_low32() + " "
! 					+ convString(trace.get_action()) + " " + trace.get_success() + " " 
  					+ trace.get_loc_x()+ " " + trace.get_loc_y());
  			
  			// once MAX_NUM_QUERIES has been performed, stop the experiment
! 			if (trace.get_action() == QUERY_RESULTS_RECEIVED) {
  				if (++numQs == MAX_NUM_QUERIES) {
  					frame.setVisible(false);
--- 136,144 ----
  			System.out.println("TRACE: " + trace.get_agentID() + " " + trace.get_nodeID() + " "
  					+ trace.get_timestamp_high32() + "" + trace.get_timestamp_low32() + " "
! 					+ convString(trace.get_action()) + " " + trace.get_qid() + " " + trace.get_success() + " " 
  					+ trace.get_loc_x()+ " " + trace.get_loc_y());
  			
  			// once MAX_NUM_QUERIES has been performed, stop the experiment
! 			if (trace.get_action() == QUERY_GET_LOCATION_RESULTS_RECEIVED) {
  				if (++numQs == MAX_NUM_QUERIES) {
  					frame.setVisible(false);

Index: TraceAnalyser.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/tools/java/edu/wustl/mobilab/directory/TraceAnalyser.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** TraceAnalyser.java	8 Apr 2006 05:55:25 -0000	1.6
--- TraceAnalyser.java	8 Apr 2006 21:28:26 -0000	1.7
***************
*** 61,65 ****
  				}
  			}
! 			else if (line.action.equals("QUERY_RESULTS_RECEIVED")) {
  				if (line.agentID != INTRUDER_AGENT_ID) {
  					if (line.success) {
--- 61,65 ----
  				}
  			}
! 			else if (line.action.equals("QUERY_GET_LOCATION_RESULTS_RECEIVED")) {
  				if (line.agentID != INTRUDER_AGENT_ID) {
  					if (line.success) {
***************
*** 83,87 ****
  	private class TraceLine implements Comparable<TraceLine> {
  		long timeStamp;
! 		int agentID, nodeID;
  		String action; 
  		boolean success;
--- 83,87 ----
  	private class TraceLine implements Comparable<TraceLine> {
  		long timeStamp;
! 		int agentID, nodeID, qid;
  		String action; 
  		boolean success;
***************
*** 108,111 ****
--- 108,116 ----
  			action = line.substring(sIndex+1, eIndex);
  			//log("action = " + action);
+ 
+ 			sIndex = eIndex;
+ 			eIndex = line.indexOf(" ", sIndex+1);
+ 			qid = Integer.valueOf(line.substring(sIndex+1, eIndex));
+ 			//log("success = " + success);
  			
  			sIndex = eIndex;
***************
*** 137,141 ****
  		public String toString() {
  			return "TRACE: " + agentID + " " + nodeID + " " + timeStamp + " " +  
! 				action + " " + (success ? "SUCCESS" : "FAIL") + " " + 
  				loc.getx() + " " + loc.gety();
  		}
--- 142,146 ----
  		public String toString() {
  			return "TRACE: " + agentID + " " + nodeID + " " + timeStamp + " " +  
! 				action + " " + qid + " " + (success ? "SUCCESS" : "FAIL") + " " + 
  				loc.getx() + " " + loc.gety();
  		}



More information about the Tinyos-contrib-commits mailing list