cat.sensor.core
Class EncounterProxy

java.lang.Object
  extended bycat.sensor.core.EncounterProxy

public class EncounterProxy
extends java.lang.Object

This is a special SensorProxy which has a sole purpose of Discovering the other agents near us. It sends multicast messages to all other agents around us. In addition, it listens for discovery messages from other agents. It keeps a list of all current agents around us.


Nested Class Summary
 class EncounterProxy.Encounter
          This class is used to send DiscoveryMessages to all agents aroudn us.
 class EncounterProxy.Update
          This class is used to keep our list of agents around us current.
 
Field Summary
private  java.util.Vector agents
          List of known/encounter/discovered agents.
private  LeafSensor leafSensor
          The LeafSensor that will receive encounter events from this proxy.
private  java.util.HashMap table
          Table contain agents and time encountered.
 
Constructor Summary
EncounterProxy(LeafSensor leafSensor)
          Constructor starts up threads for publishing and listening to Encounter events.
 
Method Summary
 void incomingMessage(Message msg)
          This is how the Sensor Proxy will Messages from iSIM.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

leafSensor

private LeafSensor leafSensor
The LeafSensor that will receive encounter events from this proxy.


table

private java.util.HashMap table
Table contain agents and time encountered.


agents

private java.util.Vector agents
List of known/encounter/discovered agents.

Constructor Detail

EncounterProxy

public EncounterProxy(LeafSensor leafSensor)
Constructor starts up threads for publishing and listening to Encounter events.

Parameters:
leafSensor - The sensor that will get info from this proxy.
Method Detail

incomingMessage

public void incomingMessage(Message msg)
This is how the Sensor Proxy will Messages from iSIM. You can then check for what type of message, and then get the data you want from the message. Then pass the datato the RawSensor.

Parameters:
msg - The incoming msg that this proxy received from other agents using CAT.