|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectpacemaker.Firefly
public abstract class Firefly
species| Field Summary | |
|---|---|
static int |
b
|
static double |
epsilon
|
static int |
inert
|
static int |
max
|
static int |
min
|
static java.lang.String |
model
|
static java.lang.String |
PAR_B
String name of the paramater used to determine the form of the Phase Response Curve (PRC) for the "MAS" model. |
static java.lang.String |
PAR_EPSILON
String name of the paramater used to determine the pulse strength parameter named epsilon for the "MAS" model. |
static java.lang.String |
PAR_INERT
String name of the paramater used to specify the inert (or refractory) post-flash period of a firefly. |
static java.lang.String |
PAR_MAX
String name of the paramater used to determine maximal period to which the Fyrefly can adapt, for the "ADAPTIVE" model. |
static java.lang.String |
PAR_MIN
String name of the paramater used to determine minimal period to which the Fyrefly can adapt, for the "ADAPTIVE" model. |
static java.lang.String |
PAR_MODEL
String name of the paramater used to specify the "reaction" model. |
static java.lang.String |
PAR_PERIOD
String name of the parameter used to determine the period of a firefly. |
static java.lang.String |
PAR_PREP
String name of the paramater used to specify the preparatory pre-flash period of a firefly. |
static java.lang.String |
PAR_PULSE_DURATION
String name of the paramater used to specify the duration of the light impulse. |
static java.lang.String |
PAR_RELAXATION
String name of the paramater used to determine the relaxation parameter that measures the rate at which the Firefly will return to its natural frequency (natural_frequency is 1/ period parameter). |
static java.lang.String |
PAR_SPECIES
String name of the parameter used to suggest the simulator you want to simulate a particular species of firefly. |
static int |
period
|
static int |
prep
|
static int |
pulse_duration
|
static double |
relaxation
|
static java.lang.String |
species
|
| Constructor Summary | |
|---|---|
Firefly(java.lang.String prefix)
|
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
|
abstract void |
doFlash()
Do Emission of a Firefly Flash. |
abstract void |
initSchedule()
Run just after contructor or clone(),
here we must set up a first event delivered to self:
because execution took place in a node when an event is delivered,
without this such first event, this node won't start. |
abstract void |
receive(peersim.core.Node my_node,
int my_pid,
java.lang.Object received_event)
Performed by Firefly when she senses a light impulse. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PAR_SPECIES
When you use this parameter, all other parameters are set automatically matching the real values for that species.
But you can also continue to use them, if your intent is to start from a real case and try out the effects of some modifications! Your params will override the original values of specified species.
Example:
protocol.myfirefly
{
species Malaccae
period 1500
... others
}
We enlisted features found in these species:
To specify one, grab just the 2nd name of the firefly species (Malaccae, Cribellata, ecc)
public static java.lang.String species
public static final java.lang.String PAR_PERIOD
As in physics, its inverse is frequency. Equivalent meanings are (to cope with different literature aliases):
To be honest, you can find any recombination of the above terms in literature ;-)
public static int period
public static final java.lang.String PAR_PULSE_DURATION
A flash is not instantaneous (unlike the term suggest): its light is interely visible along its emission for fireflies (e.g flashes last 50msec in a 700msec period for some species). The remaining time (period minus pulse_duration) is usually named "dark period". Also, fireflies seems capable to recognize the form of the light emission, that is believed to be a gaussian (Buck)
In nature this value is not longer than period. But we can experiment a lot.
public static int pulse_duration
public static final java.lang.String PAR_INERT
Just after flashing, a firefly cannot re-flash because she need some time to
refill the its energy subsystem capable of lighting.
In this state, like the "prep" parameter, the
firefly seems "refractory" to input in the sense she cannot do another flash.
However, who knows if she continues (or not) to "keep in mind" flashes
albeit unable to emit light?
In computer science, we can think it as a state of "resource busy": we cannot perform action for a while (here: flashing).
In nature this value is not longer than period. But we can experiment a lot.
public static int inert
public static final java.lang.String PAR_PREP
To do flashing, a firefly must prepare it: the neural stimulus originates from brain and reach the abdomen where the light-capable subsystem builds up the chemical reaction responsible for light emission. A certain amount of time are required for this.
In this state, like the "inert" parameter, the
firefly seems "refractory" to input in the sense she are full committed in
preparing its flash and cannot reverse or delay the started action.
However, who knows if she continues (or not) to "keep in mind" flashes
albeit unable to control its irreversible flash?
In computer science, we can think it as a state of "resource busy": we cannot perform action for a while (here: undoing flash).
In nature this value is not longer than period. But we can experiment a lot.
public static int prep
public static final java.lang.String PAR_MODEL
When receiving (input) flashes, a firefly that wants to get in sync with other can "react" by altering some of its internal parameters (phase, frequency). Consider that there are situations where input DO NOT trigger alterations. So we mean: What's the model the firefly obey?
Possible values (classification by Ermentrout 1991):
public static java.lang.String model
public static final java.lang.String PAR_B
"MAS" model.
See MaSModel for more info about PRC.
That value must be an integer and is interpred as a parameter named 'b' that influences the form of the PRC in the plane. (Mirollo and Strogatz 1990, Fig. 3)
b must be in the range ]0,+inf] for the definition of f(x). When b approaches 0, f(x) resembles the identity function (y=x). But when b exactly equal 0, the function shape degenerates. So, in this implementation we accept 0: when you supply it we will substitute the above f(x) with identity f(x)=x.
MaSModel,
Constant Field Valuespublic static int b
public static final java.lang.String PAR_EPSILON
"MAS" model.Epsilon is real number in [0,1] and models how much an incoming flash will influence the state of the receiving Firefly. In the "MAS" model the firefly flashes when PRC reaches (1,1), epsilon is a constant that makes the firefly state jump toward (1,1). The bigger epsilon, the bigger the probability that an incoming flash will trigger an immediate flash in the receiving firefly.
MaSModel,
Constant Field Valuespublic static double epsilon
public static final java.lang.String PAR_MAX
"ADAPTIVE" model.
Can't be smaller of the Firefly period parameter.
AdaptiveModel,
Constant Field Valuespublic static int max
public static final java.lang.String PAR_MIN
"ADAPTIVE" model.
Can't be bigger of the Firefly period parameter.
AdaptiveModel,
Constant Field Valuespublic static int min
public static final java.lang.String PAR_RELAXATION
period parameter).
Used for the "ADAPTIVE" model.
In literature (Ermentrout, 1991), it's named epsilon but it's not the same
epsilon of the "MAS" model. So I renamed it.
AdaptiveModel,
Constant Field Valuespublic static double relaxation
| Constructor Detail |
|---|
public Firefly(java.lang.String prefix)
| Method Detail |
|---|
public java.lang.Object clone()
clone in class java.lang.Objectpublic abstract void initSchedule()
contructor or clone(),
here we must set up a first event delivered to self:
because execution took place in a node when an event is delivered,
without this such first event, this node won't start.
public abstract void doFlash()
Here you implement a 'firefly flash' so you should keep in mind some characteristics of that flash:
public abstract void receive(peersim.core.Node my_node,
int my_pid,
java.lang.Object received_event)
In addition to the list of things (see doFlash()) a
good implementation should address these:
The parameters are inspired by the signature of
EDProtocol.processEvent(Node, int, Object)
because very probably this method is called by it.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||