public class InterVehicleCommunicator extends Object implements Runnable
Constructor and Description |
---|
InterVehicleCommunicator(Execution execution)
Creates a new instance of InterVehicleCommunicator
|
InterVehicleCommunicator(Tactical tactical,
int VID,
int port,
String address)
Creates a new instance of InterVehicleCommunicator if no execution level exists
(i.e., comms parameters must be explicitly listed)
|
Modifier and Type | Method and Description |
---|---|
void |
addNewReceivedMessage(AvclMessage newMsg)
Adds a new message to the inbound message buffer
|
int |
getNumReceivedMessages() |
AvclMessage |
getReceivedMessage() |
void |
receiveMessage()
Reads a message from the queue and adds it to the received message buffer
|
void |
run()
Implements the Runnable interface
|
void |
sendMessage(AvclMessage msg)
Sends a message from this vehicle over the multicast socket
|
public InterVehicleCommunicator(Execution execution)
execution
- vehicle objectpublic InterVehicleCommunicator(Tactical tactical, int VID, int port, String address)
VID
- vehicle IDport
- communications port that is to be usedaddress
- internet address that is to be usedpublic void addNewReceivedMessage(AvclMessage newMsg)
newMsg
- AvclMessage object being added to the bufferpublic int getNumReceivedMessages()
public AvclMessage getReceivedMessage()
public void sendMessage(AvclMessage msg)
msg
- AVCL message object that is to be sentpublic void receiveMessage()