firefly_PLL

firefly_PLL preview image

1 collaborator

Default-person renato loureiro (Author)

Tags

biology 

Tagged by renato loureiro almost 3 years ago

Visible to everyone | Changeable by the author
Model was written in NetLogo 6.2.2 • Viewed 133 times • Downloaded 11 times • Run 0 times
Download the 'firefly_PLL' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


WHAT IS IT?

This model is based in the Wilensky, U. (1997). NetLogo Fireflies model. However, in this model all fireflies have an internal digital PLL 1Hz +/- 15%. The original name of this model is Mamuan, which is the Tupi word for firefly. Tupi was the indigenous language spoken in Brazil during the early Colonial Period.

HOW IT WORKS

In the beginning all fireflies are set up with a random frequency (within the boundaries) in a random point of its internal cycle. Each firefly checks for other fireflies in the vicinity, within its radius length (as set up in the interface slider control.) If there is none, it flies away until finds one to follow. The follower then lands and chooses another one as target for synchronization. From now on, at each cycle, the follower checks the target's frequency and, using its own zero as reference, it also checks the target's position in the cycle (phase difference). It uses these information to adjust its next period or (if it is out of the boundaries) randomly chooses another target within its radius length to synchronize. After a while we can see the synchronization beginning.

HOW TO USE IT

GO: starts and stops the simulation.

SETUP: resets the simulation according to the parameters set by the sliders.

NUMBER: sets the number of fireflies to be created.

FLASH-LENGTH: sets the duration of each flash as percent of the full cycle.

RADIUS-LENGTH: sets the maximum distance where one firefly can be, to be eligible as target for synchronization by the follower.

SHOW-DARK-FIREFLIES?: if switch set to on, non-flashing fireflies are displayed in gray. If switch set to off, non-flashing fireflies are colored black and, thus, invisible.

The NUMBER slider is the only control that doesn't have any effect on a simulation in progress. All the others can be modified on-the-fly to influence the simulation.

THINGS TO NOTICE

Using the default settings (number: 100, radius-length: 20, flash-length: 10%) we will see, on the rolling plot, the number of yellow fireflies starting to peak around a narrow time range and eventually reaching the total (or near the total) number of fireflies in a perfect (or almost perfect, to be honest) synchronization.

The radius-length is an important parameter to be tuned when changing the firefly number.

Fireflies in small numbers sometimes synchronize in groups.

Synchronization occurs even in a non-toroidal world.

CREDITS AND REFERENCES

Buck, John. (1988). Synchronous Rhythmic Flashing of Fireflies. The Quarterly Review of Biology, September 1988, 265 - 286.

Carlson, A.D. & Copeland, J. (1985). Flash Communication in Fireflies. The Quarterly Review of Biology, December 1985, 415 - 433.

HOW TO CITE

If you mention this model or the NetLogo software in a publication, we ask that you include the citations below.

For the model itself:

  • Loureiro, Renato (2019). NetLogo firefly_PLL model. lourteg@uol.com.br

  • Wilensky, U. (1997). NetLogo Fireflies model. http://ccl.northwestern.edu/netlogo/models/Fireflies. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.

Please cite the NetLogo software as:

COPYRIGHT AND LICENSE

Copyright 1997 Uri Wilensky.

CC BY-NC-SA 3.0

This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

Commercial licenses are also available. To inquire about commercial licenses, please contact Uri Wilensky at uri@northwestern.edu.

This model was created as part of the project: CONNECTED MATHEMATICS: MAKING SENSE OF COMPLEX PHENOMENA THROUGH BUILDING OBJECT-BASED PARALLEL MODELS (OBPML). The project gratefully acknowledges the support of the National Science Foundation (Applications of Advanced Technologies Program) -- grant numbers RED #9552950 and REC #9632612.

This model was converted to NetLogo as part of the projects: PARTICIPATORY SIMULATIONS: NETWORK-BASED DESIGN FOR SYSTEMS LEARNING IN CLASSROOMS and/or INTEGRATED SIMULATION AND MODELING ENVIRONMENT. The project gratefully acknowledges the support of the National Science Foundation (REPP & ROLE programs) -- grant numbers REC #9814682 and REC-0126227. Converted from StarLogoT to NetLogo, 2001.

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

globals [flag]

turtles-own
[
  target
  flash_cnt
  flash_thresh
  signal
  internal
  phase_diff
  edge
]

to setup
  clear-all
  create-turtles number
  [
    setxy random-xcor random-ycor
    set shape "firefly"
    set flash_thresh 250
    set phase_diff 0
    set flash_cnt  random flash_thresh
    set edge false
    set size 2
    set signal 0
    while [ signal = 0 ]
    [ set signal 1 - random 3 ]
    set target one-of other turtles in-radius radius-lenght
    blink
  ]
  reset-ticks
end 

to go
  ask turtles
  [
    blink
    trigger
    pll
  ]
  tick
end 

to blink
  ifelse (flash_cnt <= flash_thresh * flash-length / 100)
  [
    show-turtle
    set color yellow
  ]
  [
    set color gray - 2
    ifelse show-dark-fireflies?
    [ show-turtle ]
    [ hide-turtle ]
  ]
end 

to pll
  set flash_cnt (flash_cnt + 0.5 * signal)
  if flash_cnt >= flash_thresh
  [ set signal -1 ]
  if flash_cnt <= 0
  [
    set flash_thresh (round ((250 + 3 * flash_thresh + phase_diff / 16) / 4))
    set signal 1
    set target one-of other turtles in-radius radius-lenght
  ]
end 

to trigger
  if target = nobody
  [ fly ]
  ask target
  [
    ifelse signal > 0
    [ set flag true ]
    [ set flag false ]
  ]
  ifelse edge = true
  [
    if flag = true
    [
      set edge false
      set phase_diff (signal * flash_cnt)
    ]
  ]
  [
    if flag = false
    [ set edge true ]
  ]
end 

to fly
  while [ target = nobody ]
  [
    rt random-float 90 - random-float 90
    fd 1
    set target one-of other turtles in-radius radius-lenght
  ]
end 


; Copyright 1997 Uri Wilensky.
; See Info tab for full copyright and license.

There is only one version of this model, created almost 3 years ago by renato loureiro.

Attached files

File Type Description Last updated
firefly_PLL.png preview Preview for 'firefly_PLL' almost 3 years ago, by renato loureiro Download

This model does not have any ancestors.

This model does not have any descendants.