|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--EDU.gatech.cc.is.communication.TransceiverHard
The TransceiverHard class implements the Transceiver interface so a robot can communicate.
Copyright (c)1998 Tucker Balch
Field Summary | |
static int |
BUF_SIZE
The maximum number of messages the receive buffer can hold. |
Constructor Summary | |
TransceiverHard(java.lang.String s,
int i)
Make a real transceiver object. |
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. |
static void |
main(java.lang.String[] args)
Code to test the communication system. |
void |
multicast(int[] ids,
Message m)
Transmit a message to specific teammates. |
void |
quit()
quit. |
void |
run()
Thread to monitor incoming messages. |
void |
setCommunicationMaxRange(double r)
NOT IMPLEMENTED Set the maximum range at which communication can occur. |
void |
unicast(int i,
Message m)
Transmit a message to just one teammate. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int BUF_SIZE
Constructor Detail |
public TransceiverHard(java.lang.String s, int i)
s
- String, the server host.i
- int, the robot id.Method Detail |
public void run()
public void broadcast(Message m)
m
- Message, the message to be broadcast.public void unicast(int i, Message m) throws CommunicationException
i
- int, the ID of the agent to receive the message.m
- Message, the message to transmit.public void multicast(int[] ids, Message m) throws CommunicationException
ids
- int[], the IDs of the agents to receive the message.m
- Message, the message to transmit.public CircularBufferEnumeration getReceiveChannel()
Transceiver c = new TranscieverHard(); Enumeration r = c.getReceiveChannel(); while (r.hasMoreElements()) System.out.println(r.nextElement());
public void setCommunicationMaxRange(double r)
r
- double, the maximum range.public boolean connected()
public void quit()
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |