[Tinyos-contrib-commits] CVS: tinyos-1.x/contrib/wustl/tools/java/edu/wustl/mobilab/agilla Address.java, 1.5, 1.5.2.1 AgentInjector.java, 1.22, 1.22.2.1 AgentReceiver.java, 1.2, 1.2.4.1 AgentSender.java, 1.12, 1.12.2.1 AgillaAssembler.java, 1.14, 1.14.2.1 AgillaProperties.java, 1.11, 1.11.2.1 Injector.java, 1.8, 1.8.2.1 InstructionCounter.java, 1.2, 1.2.4.1 OpStack.java, 1.2, 1.2.4.1 ProgramTokenizer.java, 1.8, 1.8.2.1 QueryNeighborList.java, 1.1, 1.1.2.1 SNInterface.java, 1.12, 1.12.2.1 SwingAgentInjectorGUI.java, 1.11, 1.11.2.1 Tester.java, 1.7, 1.7.2.1 TimeoutTimer.java, 1.3, 1.3.2.1 Tuple.java, 1.3, 1.3.4.1 TupleSpace.java, 1.16, 1.16.2.1

Chien-Liang Fok chien-liang at users.sourceforge.net
Tue Nov 14 20:30:42 PST 2006


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

Modified Files:
      Tag: GroupComm
	Address.java AgentInjector.java AgentReceiver.java 
	AgentSender.java AgillaAssembler.java AgillaProperties.java 
	Injector.java InstructionCounter.java OpStack.java 
	ProgramTokenizer.java QueryNeighborList.java SNInterface.java 
	SwingAgentInjectorGUI.java Tester.java TimeoutTimer.java 
	Tuple.java TupleSpace.java 
Log Message:
Added a proxy heart beat and a virtual ID for the proxy.

Index: Address.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/tools/java/edu/wustl/mobilab/agilla/Address.java,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -C2 -d -r1.5 -r1.5.2.1
*** Address.java	5 Apr 2006 10:28:21 -0000	1.5
--- Address.java	15 Nov 2006 04:30:39 -0000	1.5.2.1
***************
*** 6,11 ****
   * @author Chien-Liang Fok <liangfok at wustl.edu>
   */
! public class Address
  {
  	private int addr;
  	private int hopsToGW;
--- 6,15 ----
   * @author Chien-Liang Fok <liangfok at wustl.edu>
   */
! public class Address implements java.io.Serializable
  {
+ 	/**
+ 	 * 
+ 	 */
+ 	private static final long serialVersionUID = 5489902380755975025L;
  	private int addr;
  	private int hopsToGW;

Index: AgentInjector.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/tools/java/edu/wustl/mobilab/agilla/AgentInjector.java,v
retrieving revision 1.22
retrieving revision 1.22.2.1
diff -C2 -d -r1.22 -r1.22.2.1
*** AgentInjector.java	15 Nov 2006 00:22:34 -0000	1.22
--- AgentInjector.java	15 Nov 2006 04:30:39 -0000	1.22.2.1
***************
*** 1,689 ****
! // $Id$
! 
! /* Agilla - A middleware for wireless sensor networks.
!  * Copyright (C) 2004, Washington University in Saint Louis
!  * By Chien-Liang Fok.
!  *
!  * Washington University states that Agilla is free software;
!  * you can redistribute it and/or modify it under the terms of
!  * the current version of the GNU Lesser General Public License
!  * as published by the Free Software Foundation.
[...1371 lines suppressed...]
! 		
! 		public void run () {
! 			while(true) {
! 				AgillaSetBSMsgJ bsMsg = new AgillaSetBSMsgJ(vID); // notify mote it is a base station
! 				injector.sendMsg(bsMsg);
! 				try {
! 					Thread.sleep(3000);
! 				} catch(Exception e) {
! 					e.printStackTrace();
! 				}
! 			}
! 		}
! 	}
! 	
! 	private void log(String msg) {
! 		Debugger.dbg("AgentInjector", msg);
! 	}
! 	
! }
! 

Index: AgentReceiver.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/tools/java/edu/wustl/mobilab/agilla/AgentReceiver.java,v
retrieving revision 1.2
retrieving revision 1.2.4.1
diff -C2 -d -r1.2 -r1.2.4.1
*** AgentReceiver.java	11 Nov 2005 02:15:49 -0000	1.2
--- AgentReceiver.java	15 Nov 2006 04:30:39 -0000	1.2.4.1
***************
*** 55,59 ****
  {
  	private MoteIF moteIF;
! 	private Vector listeners = new Vector();
  	private boolean useAcks;
  	
--- 55,59 ----
  {
  	private MoteIF moteIF;
! 	private Vector<MigrationListener> listeners = new Vector<MigrationListener>();
  	private boolean useAcks;
  	

Index: AgentSender.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/tools/java/edu/wustl/mobilab/agilla/AgentSender.java,v
retrieving revision 1.12
retrieving revision 1.12.2.1
diff -C2 -d -r1.12 -r1.12.2.1
*** AgentSender.java	13 Feb 2006 18:05:14 -0000	1.12
--- AgentSender.java	15 Nov 2006 04:30:39 -0000	1.12.2.1
***************
*** 53,58 ****
  	
  	private SNInterface sni;
! 	private Vector queue;  // a queue of outgoing agents
! 	private Vector msgQueue = new Vector();
  	private boolean waitForAcks;
  	
--- 53,58 ----
  	
  	private SNInterface sni;
! 	private Vector<PendingAgent> queue;  // a queue of outgoing agents
! 	private Vector<MessageJ> msgQueue = new Vector<MessageJ>();
  	private boolean waitForAcks;
  	
***************
*** 65,69 ****
  	public AgentSender(SNInterface sni, boolean waitForAcks) {
  		this.sni = sni;
! 		this.queue = new Vector();
  		this.waitForAcks = waitForAcks;
  //		sni.registerListener(new AgillaAckStateMsgJ(), this);
--- 65,69 ----
  	public AgentSender(SNInterface sni, boolean waitForAcks) {
  		this.sni = sni;
! 		this.queue = new Vector<PendingAgent>();
  		this.waitForAcks = waitForAcks;
  //		sni.registerListener(new AgillaAckStateMsgJ(), this);

Index: AgillaAssembler.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/tools/java/edu/wustl/mobilab/agilla/AgillaAssembler.java,v
retrieving revision 1.14
retrieving revision 1.14.2.1
diff -C2 -d -r1.14 -r1.14.2.1
*** AgillaAssembler.java	25 May 2006 02:33:26 -0000	1.14
--- AgillaAssembler.java	15 Nov 2006 04:30:39 -0000	1.14.2.1
***************
*** 83,97 ****
  	 * (a String), and the value is the mode opcode (a String). 
  	 */
! 	private Hashtable exTable = new Hashtable();
  	
  	/**
  	 * Maps an instruction (String) to its byte code (Byte).
  	 */
!     private Hashtable s2bTable = new Hashtable();
      
      /**
       * Maps a byte code (Byte) to an instruction (String).
       */
!     private Hashtable b2sTable = new Hashtable();
      
      /**
--- 83,97 ----
  	 * (a String), and the value is the mode opcode (a String). 
  	 */
! 	private Hashtable<String, String> exTable = new Hashtable<String, String>();
  	
  	/**
  	 * Maps an instruction (String) to its byte code (Byte).
  	 */
!     private Hashtable<String, Byte> s2bTable = new Hashtable<String, Byte>();
      
      /**
       * Maps a byte code (Byte) to an instruction (String).
       */
!     private Hashtable<Short, String> b2sTable = new Hashtable<Short, String>();
      
      /**
***************
*** 102,106 ****
       * in this table.
       */
!     private Hashtable argNumTable = new Hashtable();
  
      /**
--- 102,106 ----
       * in this table.
       */
!     private Hashtable<String, Integer> argNumTable = new Hashtable<String, Integer>();
  
      /**
***************
*** 114,118 ****
       * STRING, etc., that are mapped to integers.
       */
!     private Hashtable argValTable = new Hashtable();
      
      /**
--- 114,118 ----
       * STRING, etc., that are mapped to integers.
       */
!     private Hashtable<String, Hashtable<String, Integer>> argValTable = new Hashtable<String, Hashtable<String, Integer>>();
      
      /**
***************
*** 125,129 ****
       * in this hashtable.
       */
!     private Hashtable argSizeTable = new Hashtable();
      
      /**
--- 125,129 ----
       * in this hashtable.
       */
!     private Hashtable<String, Integer> argSizeTable = new Hashtable<String, Integer>();
      
      /**
***************
*** 132,136 ****
       * is not in this table, it is assumed to be type "value".
       */
!     private Hashtable argTypeTable = new Hashtable();
      
      /**
--- 132,136 ----
       * is not in this table, it is assumed to be type "value".
       */
!     private Hashtable<String, String> argTypeTable = new Hashtable<String, String>();
      
      /**
***************
*** 139,143 ****
       * is an Integer. 
       */
!     private Hashtable argNumBitsTable = new Hashtable();
      
      /**
--- 139,143 ----
       * is an Integer. 
       */
!     private Hashtable<String, Integer> argNumBitsTable = new Hashtable<String, Integer>();
      
      /**
***************
*** 145,149 ****
       * addresses.
       */
!     private Vector argRelAddr = new Vector();
      
      /**
--- 145,149 ----
       * addresses.
       */
!     private Vector<String> argRelAddr = new Vector<String>();
      
      /**
***************
*** 179,183 ****
  						String code = name.substring("ArgValOP".length());
  						String[][] argVals = (String[][])field.get(null);
! 						Hashtable vals = new Hashtable();
  						for (int k = 0; k < argVals.length; k++) {
  							vals.put(argVals[k][0], new Integer(argVals[k][1]));
--- 179,183 ----
  						String code = name.substring("ArgValOP".length());
  						String[][] argVals = (String[][])field.get(null);
! 						Hashtable<String, Integer> vals = new Hashtable<String, Integer>();
  						for (int k = 0; k < argVals.length; k++) {
  							vals.put(argVals[k][0], new Integer(argVals[k][1]));
***************
*** 326,330 ****
  	public ProgramTokenizer expandMode(ProgramTokenizer tokenizer) 
  	{
! 		Vector prog = tokenizer.getProgram();
  		for (int i = 0; i < prog.size(); i++) 
  		{
--- 326,330 ----
  	public ProgramTokenizer expandMode(ProgramTokenizer tokenizer) 
  	{
! 		Vector<Instruction> prog = tokenizer.getProgram();
  		for (int i = 0; i < prog.size(); i++) 
  		{
***************
*** 373,377 ****
  		expandMode(tokenizer); // make sure the mode switch instructions are present
  		Vector program = tokenizer.getProgram();
! 		Hashtable result = new Hashtable();
  		
  		// determine what the program counter is
--- 373,377 ----
  		expandMode(tokenizer); // make sure the mode switch instructions are present
  		Vector program = tokenizer.getProgram();
! 		Hashtable<String, Integer> result = new Hashtable<String, Integer>();
  		
  		// determine what the program counter is
***************
*** 549,553 ****
  		throws Exception 
  	{
! 		Vector stringVector = new Vector(); // a vector of Bytes to hold the results		
  		Hashtable labels = getLabelTable(tokenizer);
  
--- 549,553 ----
  		throws Exception 
  	{
! 		Vector<String> stringVector = new Vector<String>(); // a vector of Bytes to hold the results		
  		Hashtable labels = getLabelTable(tokenizer);
  
***************
*** 555,559 ****
  			Instruction instr = tokenizer.nextInstruction();
  			log("Processing instruction " + instr);
! 			byte opcode = string2byte(instr.opcode());
  			byte[] args = null;
  			if (hasArgs(instr.opcode())) {
--- 555,559 ----
  			Instruction instr = tokenizer.nextInstruction();
  			log("Processing instruction " + instr);
! //			byte opcode = string2byte(instr.opcode());
  			byte[] args = null;
  			if (hasArgs(instr.opcode())) {
***************
*** 567,571 ****
  					stringVector.add("IOP" + instr.opcode());
  					for (int i = 0; i < args.length; i++) {
! 						stringVector.add(new Byte(args[i]));
  					}				
  				}
--- 567,571 ----
  					stringVector.add("IOP" + instr.opcode());
  					for (int i = 0; i < args.length; i++) {
! 						stringVector.add(new Byte(args[i]).toString());
  					}				
  				}
***************
*** 607,611 ****
  	 */
  	public byte[] toByteCode(ProgramTokenizer tokenizer)
		throws Exception 
	{
! 		Vector program = new Vector(); // a vector of Bytes to hold the results		
  		Hashtable labels = getLabelTable(tokenizer);

		while (tokenizer.hasMoreInstructions()) {
			Instruction instr = tokenizer.nextInstruction();
  			byte opcode = string2byte(instr.opcode());
--- 607,611 ----
  	 */
  	public byte[] toByteCode(ProgramTokenizer tokenizer)
		throws Exception 
	{
! 		Vector<Byte> program = new Vector<Byte>(); // a vector of Bytes to hold the results		
  		Hashtable labels = getLabelTable(tokenizer);

		while (tokenizer.hasMoreInstructions()) {
			Instruction instr = tokenizer.nextInstruction();
  			byte opcode = string2byte(instr.opcode());

Index: AgillaProperties.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/tools/java/edu/wustl/mobilab/agilla/AgillaProperties.java,v
retrieving revision 1.11
retrieving revision 1.11.2.1
diff -C2 -d -r1.11 -r1.11.2.1
*** AgillaProperties.java	15 Nov 2006 00:22:34 -0000	1.11
--- AgillaProperties.java	15 Nov 2006 04:30:39 -0000	1.11.2.1
***************
*** 1,194 ****
! // $Id$
! 
! /* Agilla - A middleware for wireless sensor networks.
!  * Copyright (C) 2004, Washington University in Saint Louis
!  * By Chien-Liang Fok.
!  *
!  * Washington University states that Agilla is free software;
!  * you can redistribute it and/or modify it under the terms of
!  * the current version of the GNU Lesser General Public License
!  * as published by the Free Software Foundation.
!  *
!  * Agilla is distributed in the hope that it will be useful, but
!  * THERE ARE NO WARRANTIES, WHETHER ORAL OR WRITTEN, EXPRESS OR
!  * IMPLIED, INCLUDING BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
!  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.
!  *
!  * YOU UNDERSTAND THAT AGILLA IS PROVIDED "AS IS" FOR WHICH NO
!  * WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. THERE ARE NO
!  * WARRANTIES AND NO REPRESENTATION THAT AGILLA IS FREE OF
!  * INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR OTHER
!  * PROPRIETARY RIGHTS.  THERE ARE NO WARRANTIES THAT SOFTWARE IS
!  * FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP DOORS", "WORMS",
!  * OR OTHER HARMFUL CODE.
!  *
!  * YOU ASSUME THE ENTIRE RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR
!  * ASSOCIATED MATERIALS, AND TO THE PERFORMANCE AND VALIDITY OF
!  * INFORMATION GENERATED USING SOFTWARE. By using Agilla you agree to
!  * indemnify, defend, and hold harmless WU, its employees, officers and
!  * agents from any and all claims, costs, or liabilities, including
!  * attorneys fees and court costs at both the trial and appellate levels
!  * for any loss, damage, or injury caused by your actions or actions of
!  * your officers, servants, agents or third parties acting on behalf or
!  * under authorization from you, as a result of using Agilla.
!  *
!  * See the GNU Lesser General Public License for more details, which can
!  * be found here: http://www.gnu.org/copyleft/lesser.html
!  */
! 
! package edu.wustl.mobilab.agilla;
! 
! import java.io.*;
! import java.util.*;
! import edu.wustl.mobilab.agilla.variables.*;
! 
! public class AgillaProperties extends Properties {
! 	static final long serialVersionUID = -4478107165233435498L;
! 	private static final AgillaProperties singleton = new AgillaProperties();
! 	
! 	private static final String DEFAULT_INIT_DIR = "C:\\tinyos\\cygwin\\opt\\tinyos-1.x\\contrib\\wustl\\apps\\AgillaAgents";
! 	private static final String DEFAULT_AGENT = "";
! 	private static final String DEFAULT_INIT_AGENT_ID = "0";
! 	private static final String DEFAULT_INIT_NODE_ID = "0";
! 	private static final String DEFAULT_RUN_TEST = "false";
! 	private static final String DEFAULT_NUM_COL = "20";
! 	private static final String DEFAULT_ENABLE_CLUSTERING = "false";
! 	private static final String DEFAULT_ENABLE_LOCATION_UPDATE_MSGS = "false";
! 	private static final String DEFAULT_NETWORK_NAME = "unk";	
! 	private static final String DEFAULT_NUM_NODES = "24"; // Used by the GUI FigurePanel 
! 	private static final String DEFAULT_BASESTATION_OFFSET_X = "0"; // used to enable global co-ordinates across sensor networks
! 	private static final String DEFAULT_BASESTATION_OFFSET_Y = "0"; // used to enable global co-ordinates across sensor networks
! 	
! 	private static String initDir, defaultAgent, nwName;
! 	private static int numCol, numNodes, basestationOffsetX, basestationOffsetY, initAgentID, initNodeID;
! 	private static boolean runTest, enableClustering, enableLocationUpdateMsgs;
! 	
! 	private AgillaProperties() {
! 		super();
! 		initDir = DEFAULT_INIT_DIR;
! 		defaultAgent = DEFAULT_AGENT;
! 		runTest = Boolean.valueOf(DEFAULT_RUN_TEST).booleanValue();
! 		numCol = Integer.valueOf(DEFAULT_NUM_COL).intValue();
! 		initAgentID = Integer.valueOf(DEFAULT_INIT_AGENT_ID).intValue();
! 		initNodeID = Integer.valueOf(DEFAULT_INIT_NODE_ID).intValue();
! 		numNodes = Integer.valueOf(DEFAULT_NUM_NODES).intValue();
! 		enableClustering = Boolean.valueOf(DEFAULT_ENABLE_CLUSTERING).booleanValue();
! 		enableLocationUpdateMsgs = Boolean.valueOf(DEFAULT_ENABLE_LOCATION_UPDATE_MSGS).booleanValue();
! 		setNetworkName(DEFAULT_NETWORK_NAME);
! 		basestationOffsetX = Integer.valueOf(DEFAULT_BASESTATION_OFFSET_X).intValue();
! 		basestationOffsetY = Integer.valueOf(DEFAULT_BASESTATION_OFFSET_Y).intValue();
! 		try {
! 			load(new FileInputStream("agilla.properties"));
! 		}
! 		catch(IOException e) { 
! 			System.err.println("No agilla.properties file found.  "
! 					+ "Consider creating an agilla.properties file. "
! 					+ "See http://mobilab.wustl.edu/projects/agilla/docs/tutorials/2_inject.html#aiproperties for "
! 					+ "details");
! 			return;
! 		}
! 		try {
! 			initDir = getProperty("initDir", DEFAULT_INIT_DIR);
! 			defaultAgent = getProperty("defaultAgent", DEFAULT_AGENT);
! 			runTest = Boolean.valueOf(getProperty("runTest", DEFAULT_RUN_TEST)).booleanValue();
! 			numCol = Integer.valueOf(getProperty("numCol", DEFAULT_NUM_COL)).intValue();
! 			initAgentID = Integer.valueOf(getProperty("initAgentID", DEFAULT_INIT_AGENT_ID)).intValue();
! 			initNodeID = Integer.valueOf(getProperty("initNodeID", DEFAULT_INIT_AGENT_ID)).intValue();
! 			numNodes = Integer.valueOf(getProperty("numNodes", DEFAULT_NUM_NODES)).intValue();
! 			enableClustering = Boolean.valueOf(getProperty("enableClustering", DEFAULT_ENABLE_CLUSTERING)).booleanValue();
! 			enableLocationUpdateMsgs = Boolean.valueOf(getProperty("enableLocationUpdateMsgs", DEFAULT_ENABLE_LOCATION_UPDATE_MSGS)).booleanValue();
! 			nwName = getProperty("nwName", DEFAULT_NETWORK_NAME);
! 			basestationOffsetX = Integer.valueOf(getProperty("basestationOffsetX", DEFAULT_BASESTATION_OFFSET_X)).intValue();
! 			basestationOffsetY = Integer.valueOf(getProperty("basestationOffsetY", DEFAULT_BASESTATION_OFFSET_Y)).intValue();
! 		} catch(Exception e) {
! 			e.printStackTrace();
! 		}
! 	}
! 	
! 	public static int numCol() {
! 		return numCol;
! 	}
! 	
! 	public static int numNodes() {
! 		return numNodes;
! 	}
! 	
! 	public static int basestationOffsetX(){
! 		return basestationOffsetX;
! 	}
! 	
! 	public static int basestationOffsetY(){
! 		return basestationOffsetY;
! 	}
! 	
! 	public boolean runTest() {
! 		return runTest;
! 	}
! 	
! 	public static boolean enableClustering() {
! 		return enableClustering;
! 	}
! 	
! 	public static boolean enableLocationUpdateMsgs() {
! 		return enableLocationUpdateMsgs;
! 	}
! 	
! 	/**
! 	 * Sets the network name.
! 	 * 
! 	 * @param name The name of the network.
! 	 */
! 	public static void setNetworkName(String name) {
! 		//System.out.println("Setting network name to be " + name);
! 		nwName = name;
! 	}
! 	
! 	/**
! 	 * Returns the name of the network as a java String.
! 	 * 
! 	 * @return The name of the network.
! 	 */
! 	public static String networkName(){
! 		return nwName;
! 	}
! 	
! 	/**
! 	 * Returns the name of the network as an AgillaString.
! 	 * 
! 	 * @return The name of the network.
! 	 */
! 	public static AgillaString getNetworkName() {
! 		return new AgillaString(nwName);
! 	}
! 	
! 	public String getInitDir() {
! 		return initDir;
! 	}
! 	
! 	public static int getInitAgentID() {
! 		return initAgentID;
! 	}
! 	
! 	public static int getInitNodeID() {
! 		return initNodeID;
! 	}
! 	
! 	public String getDefaultAgent() {
! 		return defaultAgent;
! 	}
! 	
! 	static AgillaProperties getProperties() {
! 		return singleton;
! 	}	
! 	
! 	public static final int getRadioChannel() {
! 		if (nwName.equals("aaa"))
! 			return 18;
! 		else if (nwName.equals("bbb"))
! 			return 20;
! 		else if (nwName.equals("ccc"))
! 			return 22;
! 		else
! 			return 0xffff;
! 	}
! }
--- 1,194 ----
! // $Id$
! 
! /* Agilla - A middleware for wireless sensor networks.
!  * Copyright (C) 2004, Washington University in Saint Louis
!  * By Chien-Liang Fok.
!  *
!  * Washington University states that Agilla is free software;
!  * you can redistribute it and/or modify it under the terms of
!  * the current version of the GNU Lesser General Public License
!  * as published by the Free Software Foundation.
!  *
!  * Agilla is distributed in the hope that it will be useful, but
!  * THERE ARE NO WARRANTIES, WHETHER ORAL OR WRITTEN, EXPRESS OR
!  * IMPLIED, INCLUDING BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
!  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.
!  *
!  * YOU UNDERSTAND THAT AGILLA IS PROVIDED "AS IS" FOR WHICH NO
!  * WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. THERE ARE NO
!  * WARRANTIES AND NO REPRESENTATION THAT AGILLA IS FREE OF
!  * INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR OTHER
!  * PROPRIETARY RIGHTS.  THERE ARE NO WARRANTIES THAT SOFTWARE IS
!  * FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP DOORS", "WORMS",
!  * OR OTHER HARMFUL CODE.
!  *
!  * YOU ASSUME THE ENTIRE RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR
!  * ASSOCIATED MATERIALS, AND TO THE PERFORMANCE AND VALIDITY OF
!  * INFORMATION GENERATED USING SOFTWARE. By using Agilla you agree to
!  * indemnify, defend, and hold harmless WU, its employees, officers and
!  * agents from any and all claims, costs, or liabilities, including
!  * attorneys fees and court costs at both the trial and appellate levels
!  * for any loss, damage, or injury caused by your actions or actions of
!  * your officers, servants, agents or third parties acting on behalf or
!  * under authorization from you, as a result of using Agilla.
!  *
!  * See the GNU Lesser General Public License for more details, which can
!  * be found here: http://www.gnu.org/copyleft/lesser.html
!  */
! 
! package edu.wustl.mobilab.agilla;
! 
! import java.io.*;
! import java.util.*;
! import edu.wustl.mobilab.agilla.variables.*;
! 
! public class AgillaProperties extends Properties {
! 	static final long serialVersionUID = -4478107165233435498L;
! 	private static final AgillaProperties singleton = new AgillaProperties();
! 	
! 	private static final String DEFAULT_INIT_DIR = "C:\\tinyos\\cygwin\\opt\\tinyos-1.x\\contrib\\wustl\\apps\\AgillaAgents";
! 	private static final String DEFAULT_AGENT = "";
! 	private static final String DEFAULT_INIT_AGENT_ID = "0";
! 	private static final String DEFAULT_INIT_NODE_ID = "0";
! 	private static final String DEFAULT_RUN_TEST = "false";
! 	private static final String DEFAULT_NUM_COL = "20";
! 	private static final String DEFAULT_ENABLE_CLUSTERING = "false";
! 	private static final String DEFAULT_ENABLE_LOCATION_UPDATE_MSGS = "false";
! 	private static final String DEFAULT_NETWORK_NAME = "unk";	
! 	private static final String DEFAULT_NUM_NODES = "24"; // Used by the GUI FigurePanel 
! 	private static final String DEFAULT_BASESTATION_OFFSET_X = "0"; // used to enable global co-ordinates across sensor networks
! 	private static final String DEFAULT_BASESTATION_OFFSET_Y = "0"; // used to enable global co-ordinates across sensor networks
! 	
! 	private static String initDir, defaultAgent, nwName;
! 	private static int numCol, numNodes, basestationOffsetX, basestationOffsetY, initAgentID, initNodeID;
! 	private static boolean runTest, enableClustering, enableLocationUpdateMsgs;
! 	
! 	private AgillaProperties() {
! 		super();
! 		initDir = DEFAULT_INIT_DIR;
! 		defaultAgent = DEFAULT_AGENT;
! 		runTest = Boolean.valueOf(DEFAULT_RUN_TEST).booleanValue();
! 		numCol = Integer.valueOf(DEFAULT_NUM_COL).intValue();
! 		initAgentID = Integer.valueOf(DEFAULT_INIT_AGENT_ID).intValue();
! 		initNodeID = Integer.valueOf(DEFAULT_INIT_NODE_ID).intValue();
! 		numNodes = Integer.valueOf(DEFAULT_NUM_NODES).intValue();
! 		enableClustering = Boolean.valueOf(DEFAULT_ENABLE_CLUSTERING).booleanValue();
! 		enableLocationUpdateMsgs = Boolean.valueOf(DEFAULT_ENABLE_LOCATION_UPDATE_MSGS).booleanValue();
! 		setNetworkName(DEFAULT_NETWORK_NAME);
! 		basestationOffsetX = Integer.valueOf(DEFAULT_BASESTATION_OFFSET_X).intValue();
! 		basestationOffsetY = Integer.valueOf(DEFAULT_BASESTATION_OFFSET_Y).intValue();
! 		try {
! 			load(new FileInputStream("agilla.properties"));
! 		}
! 		catch(IOException e) { 
! 			System.err.println("No agilla.properties file found.  "
! 					+ "Consider creating an agilla.properties file. "
! 					+ "See http://mobilab.wustl.edu/projects/agilla/docs/tutorials/2_inject.html#aiproperties for "
! 					+ "details");
! 			return;
! 		}
! 		try {
! 			initDir = getProperty("initDir", DEFAULT_INIT_DIR);
! 			defaultAgent = getProperty("defaultAgent", DEFAULT_AGENT);
! 			runTest = Boolean.valueOf(getProperty("runTest", DEFAULT_RUN_TEST)).booleanValue();
! 			numCol = Integer.valueOf(getProperty("numCol", DEFAULT_NUM_COL)).intValue();
! 			initAgentID = Integer.valueOf(getProperty("initAgentID", DEFAULT_INIT_AGENT_ID)).intValue();
! 			initNodeID = Integer.valueOf(getProperty("initNodeID", DEFAULT_INIT_AGENT_ID)).intValue();
! 			numNodes = Integer.valueOf(getProperty("numNodes", DEFAULT_NUM_NODES)).intValue();
! 			enableClustering = Boolean.valueOf(getProperty("enableClustering", DEFAULT_ENABLE_CLUSTERING)).booleanValue();
! 			enableLocationUpdateMsgs = Boolean.valueOf(getProperty("enableLocationUpdateMsgs", DEFAULT_ENABLE_LOCATION_UPDATE_MSGS)).booleanValue();
! 			nwName = getProperty("nwName", DEFAULT_NETWORK_NAME);
! 			basestationOffsetX = Integer.valueOf(getProperty("basestationOffsetX", DEFAULT_BASESTATION_OFFSET_X)).intValue();
! 			basestationOffsetY = Integer.valueOf(getProperty("basestationOffsetY", DEFAULT_BASESTATION_OFFSET_Y)).intValue();
! 		} catch(Exception e) {
! 			e.printStackTrace();
! 		}
! 	}
! 	
! 	public static int numCol() {
! 		return numCol;
! 	}
! 	
! 	public static int numNodes() {
! 		return numNodes;
! 	}
! 	
! 	public static int basestationOffsetX(){
! 		return basestationOffsetX;
! 	}
! 	
! 	public static int basestationOffsetY(){
! 		return basestationOffsetY;
! 	}
! 	
! 	public boolean runTest() {
! 		return runTest;
! 	}
! 	
! 	public static boolean enableClustering() {
! 		return enableClustering;
! 	}
! 	
! 	public static boolean enableLocationUpdateMsgs() {
! 		return enableLocationUpdateMsgs;
! 	}
! 	
! 	/**
! 	 * Sets the network name.
! 	 * 
! 	 * @param name The name of the network.
! 	 */
! 	public static void setNetworkName(String name) {
! 		//System.out.println("Setting network name to be " + name);
! 		nwName = name;
! 	}
! 	
! 	/**
! 	 * Returns the name of the network as a java String.
! 	 * 
! 	 * @return The name of the network.
! 	 */
! 	public static String networkName(){
! 		return nwName;
! 	}
! 	
! 	/**
! 	 * Returns the name of the network as an AgillaString.
! 	 * 
! 	 * @return The name of the network.
! 	 */
! 	public static AgillaString getNetworkName() {
! 		return new AgillaString(nwName);
! 	}
! 	
! 	public String getInitDir() {
! 		return initDir;
! 	}
! 	
! 	public static int getInitAgentID() {
! 		return initAgentID;
! 	}
! 	
! 	public static int getInitNodeID() {
! 		return initNodeID;
! 	}
! 	
! 	public String getDefaultAgent() {
! 		return defaultAgent;
! 	}
! 	
! 	public static AgillaProperties getProperties() {
! 		return singleton;
! 	}	
! 	
! 	public static final int getRadioChannel() {
! 		if (nwName.equals("aaa"))
! 			return 18;
! 		else if (nwName.equals("bbb"))
! 			return 20;
! 		else if (nwName.equals("ccc"))
! 			return 22;
! 		else
! 			return 0xffff;
! 	}
! }

Index: Injector.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/tools/java/edu/wustl/mobilab/agilla/Injector.java,v
retrieving revision 1.8
retrieving revision 1.8.2.1
diff -C2 -d -r1.8 -r1.8.2.1
*** Injector.java	15 Nov 2006 00:22:34 -0000	1.8
--- Injector.java	15 Nov 2006 04:30:39 -0000	1.8.2.1
***************
*** 1,144 ****
! // $Id$
! /* Agilla - A middleware for wireless sensor networks.
!  * Copyright (C) 2004, Washington University in Saint Louis
!  * By Chien-Liang Fok.
!  *
!  * Washington University states that Agilla is free software;
!  * you can redistribute it and/or modify it under the terms of
!  * the current version of the GNU Lesser General Public License
!  * as published by the Free Software Foundation.
!  *
!  * Agilla is distributed in the hope that it will be useful, but
!  * THERE ARE NO WARRANTIES, WHETHER ORAL OR WRITTEN, EXPRESS OR
!  * IMPLIED, INCLUDING BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
!  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.
!  *
!  * YOU UNDERSTAND THAT AGILLA IS PROVIDED "AS IS" FOR WHICH NO
!  * WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. THERE ARE NO
!  * WARRANTIES AND NO REPRESENTATION THAT AGILLA IS FREE OF
!  * INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR OTHER
!  * PROPRIETARY RIGHTS.  THERE ARE NO WARRANTIES THAT SOFTWARE IS
!  * FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP DOORS", "WORMS",
!  * OR OTHER HARMFUL CODE.
!  *
!  * YOU ASSUME THE ENTIRE RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR
!  * ASSOCIATED MATERIALS, AND TO THE PERFORMANCE AND VALIDITY OF
!  * INFORMATION GENERATED USING SOFTWARE. By using Agilla you agree to
!  * indemnify, defend, and hold harmless WU, its employees, officers and
!  * agents from any and all claims, costs, or liabilities, including
!  * attorneys fees and court costs at both the trial and appellate levels
!  * for any loss, damage, or injury caused by your actions or actions of
!  * your officers, servants, agents or third parties acting on behalf or
!  * under authorization from you, as a result of using Agilla.
!  *
!  * See the GNU Lesser General Public License for more details, which can
!  * be found here: http://www.gnu.org/copyleft/lesser.html
!  */
! package edu.wustl.mobilab.agilla;
! 
! import edu.wustl.mobilab.agilla.messages.*;
! import net.tinyos.message.*;
! import edu.wustl.mobilab.agilla.rmi.agentInjector.*;
! 
! /**
!  *  Injects an agent into the sensor network.
!  *
!  *  @author Chien-Liang Fok <liang at cse.wustl.edu>
!  */
! public class Injector implements AgillaConstants {
! 	private SNInterface sni;
! 	private AgentSender  agentSender;
! 	private TupleSpace ts;
! 	private boolean useRMI;
! 	private AgentInjectorRMI injectorRMI;
! 	private String rmihost;
! 
!     public Injector(String source) throws Exception {
! 		this.useRMI = source.startsWith("RMI:");
! 		if (!useRMI) {
! 			sni = new SNInterface();
! 			sni.registerListener(new AgillaErrorMsgJ(), ErrorDisplayer.getDisplayer());
! 			agentSender = new AgentSender(sni, true);
! 			ts = new TupleSpace(sni);
! 			new TimeSync(sni);
! 		}
! 		else {
! 			rmihost = source.substring(4);
! 			System.out.println("rmi host is " + rmihost);
! 			//let's go get the agent injector
! 			try {
! 				String name="//"+rmihost+"/AgentInjector";
! 				injectorRMI = AgentInjectorRMIFactory.agentInjectorRMI(name);
! 			} catch (Exception e2) {
! 				e2.printStackTrace();
! 			}
! 		}
!     }
! 
! 	public boolean useRMI() {
! 		return useRMI;
! 	}
! 
! 	public String getRMIHost() {
! 		return rmihost;
! 	}
! 
! 	public void setMoteIF(MoteIF moteIF) {
! 		sni.setMoteIF(moteIF);
! 	}
! 
! 	public void disconnect() {
! 		sni.disconnect();
! 	}
! 
! 	public void reset(int address) {
! 		
! 		sendMsg(new AgillaResetMsgJ(TOS_UART_ADDRESS, address));
! 	}
! 
! 	/**
! 	 * Registers an object as a message listener.
! 	 * 
! 	 * @param msg The message to listen for.
! 	 * @param listener The listener.
! 	 */
! 	public void registerListener(MessageJ msg, MessageListenerJ listener) {
! 		sni.registerListener(msg, listener);
! 	}
! 	
! 	/**
! 	 * Deregisters an object as a message listener.
! 	 * 
! 	 * @param msg The message to not listen to anymore.
! 	 * @param listener The listener that will not listen to the message anymore.
! 	 */
! 	public void deregisterListener(MessageJ msg, MessageListenerJ listener) {
! 		sni.deregisterListener(msg, listener);
! 	}
! 
! 	public void sendMsg(MessageJ msg) {
! 		try {
! 			if (sni != null) sni.send(msg);
! 		} catch(Exception e) {
! 			e.printStackTrace();
! 		}
! 	}
! 
! 	public void inject(int dest, Agent agent) {
! 		if (useRMI) {
! 			try {
! 				injectorRMI.inject(dest, agent);
! 			} catch(Exception e) {
! 				e.printStackTrace();
! 			}
! 		} else {
! 			if (Debugger.debug)
! 				System.out.println("Injecting Agent to " + dest);
! 			agentSender.send(dest, agent);
! 		}
! 	}
! 
! 	public TupleSpace getTS() {
! 		return ts;
! 	}
! }
--- 1,152 ----
! // $Id$
! /* Agilla - A middleware for wireless sensor networks.
!  * Copyright (C) 2004, Washington University in Saint Louis
!  * By Chien-Liang Fok.
!  *
!  * Washington University states that Agilla is free software;
!  * you can redistribute it and/or modify it under the terms of
!  * the current version of the GNU Lesser General Public License
!  * as published by the Free Software Foundation.
!  *
!  * Agilla is distributed in the hope that it will be useful, but
!  * THERE ARE NO WARRANTIES, WHETHER ORAL OR WRITTEN, EXPRESS OR
!  * IMPLIED, INCLUDING BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
!  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.
!  *
!  * YOU UNDERSTAND THAT AGILLA IS PROVIDED "AS IS" FOR WHICH NO
!  * WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. THERE ARE NO
!  * WARRANTIES AND NO REPRESENTATION THAT AGILLA IS FREE OF
!  * INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR OTHER
!  * PROPRIETARY RIGHTS.  THERE ARE NO WARRANTIES THAT SOFTWARE IS
!  * FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP DOORS", "WORMS",
!  * OR OTHER HARMFUL CODE.
!  *
!  * YOU ASSUME THE ENTIRE RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR
!  * ASSOCIATED MATERIALS, AND TO THE PERFORMANCE AND VALIDITY OF
!  * INFORMATION GENERATED USING SOFTWARE. By using Agilla you agree to
!  * indemnify, defend, and hold harmless WU, its employees, officers and
!  * agents from any and all claims, costs, or liabilities, including
!  * attorneys fees and court costs at both the trial and appellate levels
!  * for any loss, damage, or injury caused by your actions or actions of
!  * your officers, servants, agents or third parties acting on behalf or
!  * under authorization from you, as a result of using Agilla.
!  *
!  * See the GNU Lesser General Public License for more details, which can
!  * be found here: http://www.gnu.org/copyleft/lesser.html
!  */
! package edu.wustl.mobilab.agilla;
! 
! import edu.wustl.mobilab.agilla.messages.*;
! import net.tinyos.message.*;
! import edu.wustl.mobilab.agilla.rmi.agentInjector.*;
! 
! /**
!  *  Injects an agent into the sensor network.
!  *
!  *  @author Chien-Liang Fok <liang at cse.wustl.edu>
!  */
! public class Injector implements AgillaConstants {
! 	private SNInterface sni;
! 	private AgentSender  agentSender;
! 	private TupleSpace ts;
! 	private boolean useRMI;
! 	private AgentInjectorRMI injectorRMI;
! 	private String rmihost;
! 
!     public Injector(String source) throws Exception {
! 		this.useRMI = source.startsWith("RMI:");
! 		if (!useRMI) {
! 			sni = new SNInterface();
! 			sni.registerListener(new AgillaErrorMsgJ(), ErrorDisplayer.getDisplayer());
! 			agentSender = new AgentSender(sni, true);
! 			ts = new TupleSpace(sni);
! 			new TimeSync(sni);
! 		}
! 		else {
! 			rmihost = source.substring(4);
! 			System.out.println("rmi host is " + rmihost);
! 			//let's go get the agent injector
! 			try {
! 				String name="//"+rmihost+"/AgentInjector";
! 				injectorRMI = AgentInjectorRMIFactory.agentInjectorRMI(name);
! 			} catch (Exception e2) {
! 				e2.printStackTrace();
! 			}
! 		}
!     }
! 
! 	public boolean useRMI() {
! 		return useRMI;
! 	}
! 
! 	public String getRMIHost() {
! 		return rmihost;
! 	}
! 
! 	public void setMoteIF(MoteIF moteIF) {
! 		sni.setMoteIF(moteIF);
! 	}
! 
! 	public void disconnect() {
! 		sni.disconnect();
! 	}
! 
! 	public void reset(int address) {
! 		
! 		sendMsg(new AgillaResetMsgJ(TOS_UART_ADDRESS, address));
! 	}
! 
! 	/**
! 	 * Registers an object as a message listener.
! 	 * 
! 	 * @param msg The message to listen for.
! 	 * @param listener The listener.
! 	 */
! 	public void registerListener(MessageJ msg, MessageListenerJ listener) {
! 		sni.registerListener(msg, listener);
! 	}
! 	
! 	/**
! 	 * Deregisters an object as a message listener.
! 	 * 
! 	 * @param msg The message to not listen to anymore.
! 	 * @param listener The listener that will not listen to the message anymore.
! 	 */
! 	public void deregisterListener(MessageJ msg, MessageListenerJ listener) {
! 		sni.deregisterListener(msg, listener);
! 	}
! 
! 	public void sendMsg(MessageJ msg) {
! 		try {
! 			if (sni != null) sni.send(msg);
! 		} catch(Exception e) {
! 			e.printStackTrace();
! 		}
! 	}
! 	
! 	public void sendMsg(MessageJ msg, int addr) {
! 		try {
! 			if (sni != null) sni.send(msg, addr);
! 		} catch(Exception e) {
! 			e.printStackTrace();
! 		}
! 	}
! 
! 	public void inject(int dest, Agent agent) {
! 		if (useRMI) {
! 			try {
! 				injectorRMI.inject(dest, agent);
! 			} catch(Exception e) {
! 				e.printStackTrace();
! 			}
! 		} else {
! 			if (Debugger.debug)
! 				System.out.println("Injecting Agent to " + dest);
! 			agentSender.send(dest, agent);
! 		}
! 	}
! 
! 	public TupleSpace getTS() {
! 		return ts;
! 	}
! }

Index: InstructionCounter.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/tools/java/edu/wustl/mobilab/agilla/InstructionCounter.java,v
retrieving revision 1.2
retrieving revision 1.2.4.1
diff -C2 -d -r1.2 -r1.2.4.1
*** InstructionCounter.java	9 Dec 2005 07:24:05 -0000	1.2
--- InstructionCounter.java	15 Nov 2006 04:30:39 -0000	1.2.4.1
***************
*** 52,56 ****
  	public static String dir = "C:\\tinyos\\cygwin\\opt\\tinyos-1.x\\contrib\\wustl\\apps\\AgillaAgents";
  	
! 	private Hashtable table = new Hashtable();
  	
  	public InstructionCounter() throws IOException {
--- 52,56 ----
  	public static String dir = "C:\\tinyos\\cygwin\\opt\\tinyos-1.x\\contrib\\wustl\\apps\\AgillaAgents";
  	
! 	private Hashtable<String, Integer> table = new Hashtable<String, Integer>();
  	
  	public InstructionCounter() throws IOException {

Index: OpStack.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/tools/java/edu/wustl/mobilab/agilla/OpStack.java,v
retrieving revision 1.2
retrieving revision 1.2.4.1
diff -C2 -d -r1.2 -r1.2.4.1
*** OpStack.java	17 Nov 2005 15:37:35 -0000	1.2
--- OpStack.java	15 Nov 2006 04:30:39 -0000	1.2.4.1
***************
*** 50,54 ****
  public class OpStack implements AgillaConstants, java.io.Serializable {
  	static final long serialVersionUID = 6333906346705810964L;
! 	private Vector os = new Vector();
  	
  	public OpStack() {
--- 50,54 ----
  public class OpStack implements AgillaConstants, java.io.Serializable {
  	static final long serialVersionUID = 6333906346705810964L;
! 	private Vector<AgillaStackVariable> os = new Vector<AgillaStackVariable>();
  	
  	public OpStack() {

Index: ProgramTokenizer.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/tools/java/edu/wustl/mobilab/agilla/ProgramTokenizer.java,v
retrieving revision 1.8
retrieving revision 1.8.2.1
diff -C2 -d -r1.8 -r1.8.2.1
*** ProgramTokenizer.java	27 Sep 2006 08:40:56 -0000	1.8
--- ProgramTokenizer.java	15 Nov 2006 04:30:39 -0000	1.8.2.1
***************
*** 54,57 ****
--- 54,62 ----
  public class ProgramTokenizer implements AgillaConstants, Serializable {
  	/**
+ 	 * 
+ 	 */
+ 	private static final long serialVersionUID = 6269336627580150242L;
+ 
+ 	/**
  	 * A reference to the AgillaAssembler singleton.
  	 */
***************
*** 61,65 ****
  	 * The program, a list of Instruction objects.
  	 */
! 	private Vector program = new Vector();
  	
  	/**
--- 66,70 ----
  	 * The program, a list of Instruction objects.
  	 */
! 	private Vector<Instruction> program = new Vector<Instruction>();
  	
  	/**
***************
*** 217,221 ****
  	 * @return the tokenized program as a vector of Instruction objects.
  	 */
! 	public Vector getProgram() {
  		return program;
  	}
--- 222,226 ----
  	 * @return the tokenized program as a vector of Instruction objects.
  	 */
! 	public Vector<Instruction> getProgram() {
  		return program;
  	}

Index: QueryNeighborList.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/tools/java/edu/wustl/mobilab/agilla/QueryNeighborList.java,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -C2 -d -r1.1 -r1.1.2.1
*** QueryNeighborList.java	5 Apr 2006 23:57:24 -0000	1.1
--- QueryNeighborList.java	15 Nov 2006 04:30:39 -0000	1.1.2.1
***************
*** 4,8 ****
  
  public class QueryNeighborList implements AgillaConstants {
! 	private SNInterface sni;
  	
  	public QueryNeighborList(String source, boolean debug) throws Exception {
--- 4,8 ----
  
  public class QueryNeighborList implements AgillaConstants {
! //	private SNInterface sni;
  	
  	public QueryNeighborList(String source, boolean debug) throws Exception {

Index: SNInterface.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/tools/java/edu/wustl/mobilab/agilla/SNInterface.java,v
retrieving revision 1.12
retrieving revision 1.12.2.1
diff -C2 -d -r1.12 -r1.12.2.1
*** SNInterface.java	31 May 2006 18:49:34 -0000	1.12
--- SNInterface.java	15 Nov 2006 04:30:39 -0000	1.12.2.1
***************
*** 54,58 ****
  	 * Maps AM number -> vector of listeners.
  	 */
! 	private Hashtable lTable = new Hashtable();
  	private boolean promiscuous;
  	
--- 54,58 ----
  	 * Maps AM number -> vector of listeners.
  	 */
! 	private Hashtable<Integer, Vector<MessageListenerJ>> lTable = new Hashtable<Integer, Vector<MessageListenerJ>>();
  	private boolean promiscuous;
  	
***************
*** 154,161 ****
  		Integer key = new Integer(msg.getType());
  		if (!lTable.containsKey(key)) {
! 			lTable.put(key, new Vector());
  		}
  		
! 		Vector list = (Vector)lTable.get(key);
  		if (!list.contains(listener))
  			list.add(listener);
--- 154,161 ----
  		Integer key = new Integer(msg.getType());
  		if (!lTable.containsKey(key)) {
! 			lTable.put(key, new Vector<MessageListenerJ>());
  		}
  		
! 		Vector<MessageListenerJ> list = lTable.get(key);
  		if (!list.contains(listener))
  			list.add(listener);
***************
*** 164,168 ****
  	public void deregisterListener(MessageJ msg, MessageListenerJ listener) {
  		Integer key = new Integer(msg.getType());
! 		Vector list = (Vector)lTable.get(key);
  		if (list != null)
  			list.remove(listener);
--- 164,168 ----
  	public void deregisterListener(MessageJ msg, MessageListenerJ listener) {
  		Integer key = new Integer(msg.getType());
! 		Vector list = lTable.get(key);
  		if (list != null)
  			list.remove(listener);
***************
*** 369,376 ****
  		
  		if (to == TOS_LOCAL_ADDRESS || promiscuous) {
! 			Vector listeners = (Vector)lTable.get(new Integer(m.amType()));
  			if (listeners != null) {
  				for (int i = 0; i < listeners.size(); i++) {
! 					MessageListenerJ mlj = (MessageListenerJ)listeners.get(i);
  					mlj.messageReceived(to, msgJ);
  				}
--- 369,376 ----
  		
  		if (to == TOS_LOCAL_ADDRESS || promiscuous) {
! 			Vector<MessageListenerJ> listeners = lTable.get(new Integer(m.amType()));
  			if (listeners != null) {
  				for (int i = 0; i < listeners.size(); i++) {
! 					MessageListenerJ mlj = listeners.get(i);
  					mlj.messageReceived(to, msgJ);
  				}

Index: SwingAgentInjectorGUI.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/tools/java/edu/wustl/mobilab/agilla/SwingAgentInjectorGUI.java,v
retrieving revision 1.11
retrieving revision 1.11.2.1
diff -C2 -d -r1.11 -r1.11.2.1
*** SwingAgentInjectorGUI.java	19 May 2006 20:07:44 -0000	1.11
--- SwingAgentInjectorGUI.java	15 Nov 2006 04:30:39 -0000	1.11.2.1
***************
*** 1,1163 ****
! // $Id$
! 
! /* Agilla - A middleware for wireless sensor networks.
!  * Copyright (C) 2004, Washington University in Saint Louis
!  * By Chien-Liang Fok.
!  *
!  * Washington University states that Agilla is free software;
!  * you can redistribute it and/or modify it under the terms of
!  * the current version of the GNU Lesser General Public License
!  * as published by the Free Software Foundation.
[...2354 lines suppressed...]
! //			//				(screenSize.height - frameSize.height) / 2);
! //			setLocation((int)(ownerLoc.getX()+(ownerSize.width - frameSize.width) / 2),
! //							(int)(ownerLoc.getY() +(ownerSize.height - frameSize.height) / 2));
! //			show();
! //		}
! //
! //		public void run() {
! //			while (count++ < MAX_VALUE) {
! //				try {
! //					Thread.sleep(10);
! //				} catch(Exception e) {
! //					e.printStackTrace();
! //				}
! //				pb.setValue(count);
! //			}
! //			dispose();
! //		}
! //	}
! }
! 

Index: Tester.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/tools/java/edu/wustl/mobilab/agilla/Tester.java,v
retrieving revision 1.7
retrieving revision 1.7.2.1
diff -C2 -d -r1.7 -r1.7.2.1
*** Tester.java	20 Sep 2006 14:16:45 -0000	1.7
--- Tester.java	15 Nov 2006 04:30:39 -0000	1.7.2.1
***************
*** 7,18 ****
  package edu.wustl.mobilab.agilla;
  
! import java.io.BufferedReader;
! import java.io.File;
! import java.io.FileReader;
! import java.util.*;
! import javax.swing.JOptionPane;
! import javax.swing.JFrame;
  
! import edu.wustl.mobilab.agilla.messages.AgillaRxnMsgJ;
  import edu.wustl.mobilab.agilla.variables.*;
  
--- 7,18 ----
  package edu.wustl.mobilab.agilla;
  
! //import java.io.BufferedReader;
! //import java.io.File;
! //import java.io.FileReader;
! //import java.util.*;
! //import javax.swing.JOptionPane;
! //import javax.swing.JFrame;
  
! //import edu.wustl.mobilab.agilla.messages.AgillaRxnMsgJ;
  import edu.wustl.mobilab.agilla.variables.*;
  

Index: TimeoutTimer.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/tools/java/edu/wustl/mobilab/agilla/TimeoutTimer.java,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -C2 -d -r1.3 -r1.3.2.1
*** TimeoutTimer.java	13 Feb 2006 08:40:40 -0000	1.3
--- TimeoutTimer.java	15 Nov 2006 04:30:39 -0000	1.3.2.1
***************
*** 51,55 ****
  	
  	private boolean alive = true;
! 	private Vector msgQueue;
  	private Thread thread;
  	private long duration;
--- 51,55 ----
  	
  	private boolean alive = true;
! 	private Vector<MessageJ> msgQueue;
  	private Thread thread;
  	private long duration;
***************
*** 60,64 ****
  	 * @param duration the timeout in ms
  	 */
! 	public TimeoutTimer(Vector msgQueue, long duration, int id) 
  	{
  		this.msgQueue = msgQueue;
--- 60,64 ----
  	 * @param duration the timeout in ms
  	 */
! 	public TimeoutTimer(Vector<MessageJ> msgQueue, long duration, int id) 
  	{
  		this.msgQueue = msgQueue;

Index: Tuple.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/tools/java/edu/wustl/mobilab/agilla/Tuple.java,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -C2 -d -r1.3 -r1.3.4.1
*** Tuple.java	18 Nov 2005 00:41:44 -0000	1.3
--- Tuple.java	15 Nov 2006 04:30:39 -0000	1.3.4.1
***************
*** 51,55 ****
  	private static final long serialVersionUID = -7592530006399035044L;
  	private short flags;
! 	private Vector fields = new Vector();
  	
  	public Tuple() {
--- 51,55 ----
  	private static final long serialVersionUID = -7592530006399035044L;
  	private short flags;
! 	private Vector<AgillaStackVariable> fields = new Vector<AgillaStackVariable>();
  	
  	public Tuple() {

Index: TupleSpace.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/tools/java/edu/wustl/mobilab/agilla/TupleSpace.java,v
retrieving revision 1.16
retrieving revision 1.16.2.1
diff -C2 -d -r1.16 -r1.16.2.1
*** TupleSpace.java	19 Apr 2006 19:03:29 -0000	1.16
--- TupleSpace.java	15 Nov 2006 04:30:39 -0000	1.16.2.1
***************
*** 58,62 ****
  	//private AgillaTSResMsgJ results;
  	//private TimeoutTimer timer;
! 	private Vector ts, reactions, response;
  	private Object blocked = new Object();
  	//waiting = new Object();
--- 58,64 ----
  	//private AgillaTSResMsgJ results;
  	//private TimeoutTimer timer;
! 	private Vector<Tuple> ts = new Vector<Tuple>();
! 	private Vector<RegisteredReaction>reactions = new Vector<RegisteredReaction>();
! 	private Vector<MessageJ> response = new Vector<MessageJ>();
  	private Object blocked = new Object();
  	//waiting = new Object();
***************
*** 64,70 ****
  	public TupleSpace(SNInterface sni) {
  		this.sni = sni;
- 		ts = new Vector();
- 		reactions = new Vector();
- 		response = new Vector();
  		sni.registerListener(new AgillaTSResMsgJ(), this);
  		sni.registerListener(new AgillaTSReqMsgJ(), this);
--- 66,69 ----
***************
*** 97,101 ****
  	
  	public Tuple [] ingp(Tuple template) {
! 		Vector matchingTuples = new Vector();
  		for (int i = 0; i < ts.size(); i++) {
  			Tuple tuple = (Tuple)ts.get(i);
--- 96,100 ----
  	
  	public Tuple [] ingp(Tuple template) {
! 		Vector<Tuple> matchingTuples = new Vector<Tuple>();
  		for (int i = 0; i < ts.size(); i++) {
  			Tuple tuple = (Tuple)ts.get(i);
***************
*** 128,132 ****
  	
  	public Tuple [] rdgp(Tuple template) {
! 		Vector matchingTuples = new Vector();
  		for (int i = 0; i < ts.size(); i++) {
  			Tuple tuple = (Tuple)ts.get(i);
--- 127,131 ----
  	
  	public Tuple [] rdgp(Tuple template) {
! 		Vector<Tuple> matchingTuples = new Vector<Tuple>();
  		for (int i = 0; i < ts.size(); i++) {
  			Tuple tuple = (Tuple)ts.get(i);



More information about the Tinyos-contrib-commits mailing list