3 ms·
No, partly because fireflies take a certain amount of time to "charge" so jumping mid cycle might not be plausible physically. So what this line does (which is
by IanCal 9y ago
No, partly because fireflies take a certain amount of time to "charge" so jumping mid cycle might not be plausible physically.
So what this line does (which is in the section of code where a flash alters the fireflies around it) is that after advancing the other fireflies clocks, if any are over 1 then it puts them in the right state to flash on the next time they're evaluated. If you mod it, then you would have the logic:
"if I'm a firefly and see my neighbour flash while just about to flashing myself, don't flash but reset my clock to part way through the cycle"
rather than
"if I'm a firefly and see my neighbour flash while just about to flashing myself, flash as well"
Edit - setting it to one ensures that each neighbour can't keep adding to the clock, advancing it to a random point in the cycle.
- narrowtux 9y agoIf the fireflies take that time in their clocks to "charge the light", could it be that when they nudge their clock once or more in the cycle, the intensity of the light is a bit lower than it would normally be?
- IanCal 9y agoInteresting question. I honestly thought that the process was actually to reset the clocks not move them forwards, that's how I've simulated it in the past.