Live data from Hacker News

Fireflies

ncase.me

61–70 of 93 posts

Re: Fireflies

#61

Nature has the best algorithms, don't it folks? I have a question about a detail. The rule is: 1. When you see a nearby neighbour flash, nudge your own clock forward. 2. That's it. My question is -- when the fireflies are firing at the same time, they see each other flash, so they all nudge their clocks forward, correct? Assuming they don't nudge their clocks forward at the same amount, they would fall out of sync, c…

> If you see a neighbour nearby flash, when you are not flashing, nudge your clock forward by a bit. I think this is it. There could be some missing detail (e.g. a firefly is unable to "see" when it flashes) which keeps them from nudging their clocks once already in sync

> which keeps them from nudging their clocks once already in sync

Does it matter if they "nudge their clocks once already in sync" ? If they all do that, they'll stay in sync, with a slightly higher frequency.

Re: Fireflies

#62
post #40

Nature has the best algorithms, don't it folks? I have a question about a detail. The rule is: 1. When you see a nearby neighbour flash, nudge your own clock forward. 2. That's it. My question is -- when the fireflies are firing at the same time, they see each other flash, so they all nudge their clocks forward, correct? Assuming they don't nudge their clocks forward at the same amount, they would fall out of sync, c…

I think the rule is not very precise written down (e.g. I do not believe that a firefly nudges its clock multiple times within one cycle, just because it has multiple neighbors).

If nudging is done proportional to the intensity (or distance) of observed flashes, I'm pretty sure it will still work fine.

Re: Fireflies

#64
post #36

My only hang-up with the explanation/simulation is, why do the fireflies all have clocks that run at the same duration as one another? I understand advancing your clock to synchronize flashes, but doesn't this presuppose that the clocks run at the same speed? When I turned on "Show Clocks" in the simulation it indeed looked like the clocks ran at identical durations. Seems like this would be difficult in nature.

I imagine if they started at wildly different speeds it would still converge but the convergence would take longer.

The article only talks about changing the phase on fixed amount, nothing about fixing the frequency.

Re: Fireflies

#66

My only hang-up with the explanation/simulation is, why do the fireflies all have clocks that run at the same duration as one another? I understand advancing your clock to synchronize flashes, but doesn't this presuppose that the clocks run at the same speed? When I turned on "Show Clocks" in the simulation it indeed looked like the clocks ran at identical durations. Seems like this would be difficult in nature.

This is difficult to explain succinctly, but biochemical processes can set up periodic events with a fair amount of accuracy. For instance, your heart beats roughly once a second when in a resting state.

Some of these processes use physical latency to time the events: if the fireflies were roughly of the same maturity, they would be of similar size and thus have clocks of similar duration.

Re: Fireflies

#67
It would be even more impressive if the fireflies' internal clock was ticking at slightly different speeds. As it is now, once they're synchronized, turning the sync mechanism off has no effect and they stay synced forever.

Re: Fireflies

#69
post #42

Earlier quoted context omitted.

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…

If 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?

Interesting 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.
Post reply on HN