All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class EDU.gatech.cc.is.abstractrobot.TransceiverSim

java.lang.Object
   |
   +----EDU.gatech.cc.is.abstractrobot.TransceiverSim

public class TransceiverSim
extends Object
Implements the Transceiver interface. You can use objects of this class in your simulated robot code to easily implement the Transceiver interface for the robot.

Copyright (c)1997, 1998 Tucker Balch

Version:
$Revision: 1.3 $
Author:
Tucker Balch

Variable Index

 o BUF_SIZE
The maximum number of messages the receive buffer can hold.
 o DEBUG

Constructor Index

 o TransceiverSim(SimulatedObject, Simple)
Instantiate a TransceiverSim object.

Method Index

 o broadcast(Message, SimulatedObject[])
Transmit a message to all teammates but self.
 o connected()
Check to see if the transceiver is connected to the server.
 o getReceiveChannel()
Get an enumeration of the incoming messages.
 o multicast(int[], Message, SimulatedObject[])
Transmit a message to a list of teammates.
 o receive(Message)
Receive a message.
 o setCommunicationMaxRange(double)
Set the maximum range at which a sensor reading should be considered kin.
 o unicast(int, Message, SimulatedObject[])
Transmit a message to just one teammate.

Variables

 o BUF_SIZE
 public static final int BUF_SIZE
The maximum number of messages the receive buffer can hold.

 o DEBUG
 public static final boolean DEBUG

Constructors

 o TransceiverSim
 public TransceiverSim(SimulatedObject rs,
                       Simple r)
Instantiate a TransceiverSim object.

Parameters:
r - SimulatedObject, the robot on which the Transceiver resides.

Methods

 o multicast
 public void multicast(int ids[],
                       Message m,
                       SimulatedObject all_objects[]) throws CommunicationException
Transmit a message to a list of teammates. Transmission to self 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.
 o broadcast
 public void broadcast(Message m,
                       SimulatedObject all_objects[])
Transmit a message to all teammates but self.

Parameters:
m - Message, the message to transmit.
 o unicast
 public void unicast(int id,
                     Message m,
                     SimulatedObject all_objects[]) 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.
 o getReceiveChannel
 public Enumeration getReceiveChannel()
Get an enumeration of the incoming messages. The messages are automatically buffered by the implementation. You cannot count on all messages being delivered, unless you read them as fast as they arrive.

Returns:
the Enumeration.
 o receive
 public void receive(Message m)
Receive a message.

Parameters:
m - the message.
 o setCommunicationMaxRange
 public void setCommunicationMaxRange(double range)
Set the maximum range at which a sensor reading should be considered kin. Beyond this range, the readings are ignored.

Parameters:
range - the range in meters.
 o connected
 public boolean connected()
Check to see if the transceiver is connected to the server.


All Packages  Class Hierarchy  This Package  Previous  Next  Index