|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.speckled.specksim.imp.specks.AbstractSpeck
com.speckled.specksim.imp.specks.NeighbourlySpeck
@ConfigurableType(value="Neighbourly Speck") public class NeighbourlySpeck
This speck implementation simply broadcasts its id periodically, and keeps a decaying list of all the IDs it has received. Look in the source for voluminous comments demonstrating how to write a Speck implementation.
| Field Summary | |
|---|---|
static float |
broadcastDelay
The time delay between broadcasts |
static CarrierSenseMac |
mac
The mac protocol used to broadcast |
static float |
recordLife
The time for which a neighbour record exists |
static MessageShell |
shell
The message shell that we use to send messages |
| Fields inherited from class com.speckled.specksim.imp.specks.AbstractSpeck |
|---|
name, RNG_OFFSET_CONF_DESC, RNG_OFFSET_CONF_NAME, simulator |
| Fields inherited from interface com.speckled.specksim.Speck |
|---|
ID_BITS, SPECK_LOG_SOURCE |
| Constructor Summary | |
|---|---|
NeighbourlySpeck()
Constructs a new NeighbourlySpeck. |
|
| Method Summary | |
|---|---|
void |
deInit()
Called when the speck is removed from the simulator. |
Configurator |
getConfigurator()
Gets a Configurator object that describes and can manipulate the variables of this Configurable. |
SpeckState |
getState()
Takes a snapshot of the state of this speck. |
void |
init()
Called when the speck is added to the simulator, and when the simulator is reset. |
void |
shellEncountered(Speck sender,
MessageShell shell,
Message message)
Called when the simulator determines that this speck lies within the bounds of a transmission. |
| Methods inherited from class com.speckled.specksim.imp.specks.AbstractSpeck |
|---|
getFlavourName, getRandom, getRandomSeedOffset, id, initialise, isLoggingEnabled, setID, setLoggingEnabled, setRandomSeedOffset, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
@SubConfigurable @Priority(value=0) public static MessageShell shell
@SubConfigurable @Priority(value=1) public static CarrierSenseMac mac
@ConfigurableVariable(value="Broadcast Delay")
@Description(value="How often each speck will broadcast its ID")
@NumberRange(value={0.0f,10.0f})
@Priority(value=2)
public static float broadcastDelay
@ConfigurableVariable(value="Record Lifetime")
@Description(value="How long each speck will remember its neighbours")
@NumberRange(value={0.0f,20.0f})
@Priority(value=3)
public static float recordLife
| Constructor Detail |
|---|
public NeighbourlySpeck()
NeighbourlySpeck. Every speck
implementation must have a no-argument constructor
| Method Detail |
|---|
public void init()
AbstractSpeck
init in class AbstractSpeckpublic void deInit()
SpeckSimulationEvents that have this
speck as a parent will automatically be removed for you.
public void shellEncountered(Speck sender,
MessageShell shell,
Message message)
Speck
sender - The speck that sent the messageshell - The shell used to send the messagemessage - The content of the messagepublic SpeckState getState()
Speck
public Configurator getConfigurator()
Configurable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||