com.speckled.specksim.comm
Interface MessageShell

All Superinterfaces:
Configurable
All Known Implementing Classes:
CollimatedShell, EllipsoidShell, PerfectRadioShell, RealisticRadioShell

public interface MessageShell
extends Configurable

Defines the limits of a broadcast.

Author:
ryanm

Method Summary
 MessageShell clone()
          Override this method to return a copy of this MessageShell.
 float getBitRate()
          Gets the data transmission speed, in kilobits per second.
 Vector3d[] getBoundingBox(SpeckPosition orientation)
          Works out an axis-aligned bounding box for this message shell.
 int getChannelID()
          Gets an identifier for the channel used by this shell.
 boolean hit(Speck sender, SpeckPosition senderOrientation, Speck target, SpeckPosition targetOrientation)
          Checks to see if the sender can reach the target.
 
Methods inherited from interface com.ryanm.config.Configurable
getConfigurator
 

Method Detail

hit

boolean hit(Speck sender,
            SpeckPosition senderOrientation,
            Speck target,
            SpeckPosition targetOrientation)
Checks to see if the sender can reach the target.

Parameters:
sender - The sending speck
senderOrientation - The position of the sending speck at the time of transmission
target - The prospective receiving speck
targetOrientation - The position of the target speck at the time of transmission
Returns:
true if the sender can succesfully transmit to the target, false otherwise.

getBoundingBox

Vector3d[] getBoundingBox(SpeckPosition orientation)
Works out an axis-aligned bounding box for this message shell. This can be used as a quick rejection test when looking for broadcast recipients.

Parameters:
orientation - The orientation of the sending speck at the time of transmission
Returns:
A two-element array of Vector3Ds. The first element will be the position of the corner of the bounding box that is closest to the origin. The second element will be the corner furthest from the origin.

getBitRate

float getBitRate()
Gets the data transmission speed, in kilobits per second. Return 0 for an effectively infinite bandwidth

Returns:
the bit rate of the transceiver, kbps, or 0 if you'd rather not bother will all of this messy low-level stuff

getChannelID

int getChannelID()
Gets an identifier for the channel used by this shell. Shells operating on different channels will not interfer with each other. Radio devices should return a different value than laser devices, for example.

Returns:
An integer identifier for this channel.

clone

MessageShell clone()
Override this method to return a copy of this MessageShell. This is so that changes can be made to the shell without affecting ongoing broadcasts.

Returns:
A copy of this MessageShell, such that the clone will hit the same set of specks as the original