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

borndigerati borndigerati at users.sourceforge.net
Fri Apr 7 22:22:44 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-serv29764/edu/wustl/mobilab/directory

Modified Files:
	ExperimentDataCollector.java TraceAnalyser.java 
Log Message:
Changed format of trace logs.

Index: ExperimentDataCollector.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/tools/java/edu/wustl/mobilab/directory/ExperimentDataCollector.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ExperimentDataCollector.java	7 Apr 2006 01:16:14 -0000	1.3
--- ExperimentDataCollector.java	8 Apr 2006 05:22:41 -0000	1.4
***************
*** 112,118 ****
  		public void messageReceived(int to, Message m) {				
  			AgillaTraceMsg trace = (AgillaTraceMsg)m;
! 			System.out.println("TRACE: " + trace.get_timestamp_high32() + "" + trace.get_timestamp_low32() + " "
! 					+ trace.get_agentID() + " " + trace.get_nodeID() + " " + 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
--- 112,119 ----
  		public void messageReceived(int to, Message m) {				
  			AgillaTraceMsg trace = (AgillaTraceMsg)m;
! 			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

Index: TraceAnalyser.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/tools/java/edu/wustl/mobilab/directory/TraceAnalyser.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** TraceAnalyser.java	6 Apr 2006 01:06:08 -0000	1.3
--- TraceAnalyser.java	8 Apr 2006 05:22:41 -0000	1.4
***************
*** 23,27 ****
  			nextLine = reader.readLine();
  		}
! 		//Collections.sort(trace);
  		analyze();
  	}
--- 23,31 ----
  			nextLine = reader.readLine();
  		}
! 		Collections.sort(trace);
! 		
! 		log("Sorted trace: ");
! 		for (int i = 0; i < trace.size(); i++)
! 			log(trace.get(i).toString());
  		analyze();
  	}
***************
*** 86,94 ****
  			int sIndex = line.indexOf(" ");
  			int eIndex = line.indexOf(" ", sIndex+1);
- 			timeStamp = Long.valueOf(line.substring(sIndex+1, eIndex));
- 			//log("timeStamp = " + timeStamp);
- 			
- 			sIndex = eIndex;
- 			eIndex = line.indexOf(" ", sIndex+1);
  			agentID = Integer.valueOf(line.substring(sIndex+1, eIndex));
  			//log("agentID = " + agentID);
--- 90,93 ----
***************
*** 101,104 ****
--- 100,108 ----
  			sIndex = eIndex;
  			eIndex = line.indexOf(" ", sIndex+1);
+ 			timeStamp = Long.valueOf(line.substring(sIndex+1, eIndex));
+ 			//log("timeStamp = " + timeStamp);
+ 			
+ 			sIndex = eIndex;
+ 			eIndex = line.indexOf(" ", sIndex+1);
  			action = line.substring(sIndex+1, eIndex);
  			//log("action = " + action);
***************
*** 129,133 ****
  				return 1;
  		}
! 	}
  	
  	private void log(String msg) {
--- 133,143 ----
  				return 1;
  		}
! 		
! 		public String toString() {
! 			return "TRACE: " + agentID + " " + nodeID + " " + timeStamp + " " +  
! 				action + " " + (success ? "SUCCESS" : "FAIL") + " " + 
! 				loc.getx() + " " + loc.gety();
! 		}
! 	} // TraceLine
  	
  	private void log(String msg) {



More information about the Tinyos-contrib-commits mailing list