All Packages Class Hierarchy This Package Previous Next Index
Class EDU.gatech.cc.is.communication.TransceiverHard
java.lang.Object
|
+----EDU.gatech.cc.is.communication.TransceiverHard
- public class TransceiverHard
- extends Object
- implements Transceiver, Runnable
The TransceiverHard class implements the Transceiver interface
so a robot can communicate.
Copyright
(c)1998 Tucker Balch
- Version:
- $Revision: 1.2 $
- Author:
- Tucker Balch
-
BUF_SIZE
- The maximum number of messages the receive buffer can hold.
-
TransceiverHard(String, int)
- Make a real transceiver object.
-
broadcast(Message)
- Broadcast a message to all teammates, except self.
-
connected()
- Check to see if the transceiver is connected to the server.
-
getReceiveChannel()
- Get an enumeration of the incoming messages.
-
main(String[])
- Code to test the communication system.
-
multicast(int[], Message)
- Transmit a message to specific teammates.
-
quit()
- quit.
-
run()
- Thread to monitor incoming messages.
-
setCommunicationMaxRange(double)
- NOT IMPLEMENTED
Set the maximum range at which communication can occur.
-
unicast(int, Message)
- Transmit a message to just one teammate.
BUF_SIZE
public static final int BUF_SIZE
- The maximum number of messages the receive buffer can hold.
TransceiverHard
public TransceiverHard(String s,
int i)
- Make a real transceiver object.
- Parameters:
- s - String, the server host.
- i - int, the robot id.
run
public void run()
- Thread to monitor incoming messages.
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 i,
Message m) throws CommunicationException
- Transmit a message to just one teammate. Transmission to
self is allowed.
- Parameters:
- i - 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. NOT IMPLEMENTED.
getReceiveChannel
public Enumeration getReceiveChannel()
- Get an enumeration of the incoming messages. The messages
are automatically buffered for you.
Since this is implemented as a circular you cannot
count on all messages being delivered unless you read from
the buffer faster than messages are received.
Example, to print all incoming messages:
Transceiver c = new TranscieverHard();
Enumeration r = c.getReceiveChannel();
while (r.hasMoreElements())
System.out.println(r.nextElement());
- Returns:
- the Enumeration.
setCommunicationMaxRange
public void setCommunicationMaxRange(double r)
- NOT IMPLEMENTED
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()
- quit.
main
public static void main(String args[])
- Code to test the communication system.
All Packages Class Hierarchy This Package Previous Next Index