EDU.gatech.cc.is.communication
Interface Transceiver

All Known Subinterfaces:
Capture, CommN150, MultiForageN150, RescueVan, SocSmall
All Known Implementing Classes:
TransceiverHard

public interface Transceiver

The Transceiver class provides an abstract interface to the hardware of a robot that can communicate.

Copyright (c)1998 Georgia Tech Research Corporation


Method Summary
 void broadcast(Message m)
          Broadcast a message to all teammates, except self.
 boolean connected()
          Check to see if the transceiver is connected to the server.
 CircularBufferEnumeration getReceiveChannel()
          Get an enumeration of the incoming messages.
 void multicast(int[] ids, Message m)
          Transmit a message to specific teammates.
 void quit()
          Terminate the connection.
 void setCommunicationMaxRange(double r)
          Set the maximum range at which communication can occur.
 void unicast(int id, Message m)
          Transmit a message to just one teammate.
 

Method Detail

broadcast

public void broadcast(Message m)
Broadcast a message to all teammates, except self.
Parameters:
m - Message, the message to be broadcast.

unicast

public void unicast(int id,
                    Message m)
             throws CommunicationException
Transmit a message to just one teammate. Transmission to self is allowed.
Parameters:
id - int, the ID of the agent to receive the message.
m - Message, the message to transmit.
Throws:
CommunicationException - if the receiving agent does not exist.

multicast

public void multicast(int[] ids,
                      Message m)
               throws CommunicationException
Transmit a message to specific teammates. Transmission to self is allowed.
Parameters:
ids - int[], the IDs of the agents to receive the message.
m - Message, the message to transmit.
Throws:
CommunicationException - if one of the receiving agents does not exist.

getReceiveChannel

public CircularBufferEnumeration getReceiveChannel()
Get an enumeration of the incoming messages. The messages are automatically buffered by the implementation. Unless the implementation guarantees it, you cannot count on all messages being delivered. Example, to print all incoming messages:
 Transceiver c = new RobotComm();
 Enumeration r = c.getReceiveChannel();
 while (r.hasMoreElements())
 	System.out.println(r.nextElement());
 
Returns:
the Enumeration.

setCommunicationMaxRange

public void setCommunicationMaxRange(double r)
Set the maximum range at which communication can occur. In simulation, this corresponds to a simulation of physical limits, on mobile robots it corresponds to a signal strength setting.
Parameters:
r - double, the maximum range.

connected

public boolean connected()
Check to see if the transceiver is connected to the server.

quit

public void quit()
Terminate the connection.