Pineda López Omar Karim - Firefly model

Extension of NetLogo’s Firefly model for heterogeneous oscillators.

In this model each firefly, in addition to having a clock, they have a variable that indicates the length of its cycle.

The fireflies are looking all the time, when a firefly is off but the ones around are on, then the firefly resets its clock to the FLASH-LENGTH (just after a flash would normally occur). This causes the firefly to synchronize with the next flash of the firefly it is responding to. In addition, if it is about to finish its cycle, then the cycle length is reduced, since having had a shorter cycle the firefly would have turned on at the right time.

On the other hand, if the firefly turns on again but those around did not, that indicates that its cycle must be shorter than the others, so it increases its cycle length.

V2 update: Each firefly count the number of ticks that takes the fireflies around to turn on again, trying to find out their cycle to modify its own.

The cycle of all the fireflies converges to the value of the firefly with the minimum cycle.