Attempts to send a message with the specified contents to the specified
recipient. The actual sending of a message is done at the end of the
current tick. Based on the reliability, range and position it is determined
whether the message will be sent. Until a message is sent it lives in the
#getOutbox() of the device.
Reliability If this device has a reliability of p
there
is a probability of 1-p
that the message will not be sent. If
the receiving device has a reliability of r
there is a
probability of 1-r
that the message will not be received at
the other end. This means that in practice the probability of an
unsuccessful delivery is 1 - (p * r)
.
Range If this device has a maximum range the message will only be
delivered if the recipient is within that range at the moment of sending
at the end of the tick. Note that the range only influences sending of
messages, it is possible to receive messages from senders that are outside
of its max range.
Position If the
CommUser that owns this device has no
position (
CommUser#getPosition() is absent) and this device
has a maximum range (
#getMaxRange() is present). The message will
not be sent and will stay in the outbox of this device (see
#getOutbox()). If at a later stage the
CommUser gets a
position all messages that are still in the outbox will be sent. The outbox
can be cleared by calling
#clearOutbox().