>>14252266>>14252304>>14252309While I cannot give you any concrete evidence to support my claims, I do "believe" insects have what I'd call "inner algorithms". I reason this because of an observation I had of a portuguese millipede. I watched as it traversed the carpet alongside the skirting board. I noticed that rather than turning into the skirting board it turned to the right towards "freedom", that is away from the skirting board. I wondered why didn't it turn towards the skirting board and bash its head against it? it must have some kind of sensory perception I figured. Not wanting this bug to disappear on me I got a glass and put it over it. I observed that when the millipede reached the glass it started walking around the class in a clockwise fashion. After walking approximately half way around the glass it stopped, did a 180 and paused, and then continued on in the other direction. It then kept repeating the 180, pause, and continuing on. I came to the conclusion that there must be some kind of algorithm at play influencing its "decision making" process.
As for your fly, think of it like a function in a computer program. The fly will proceed towards food and if it encounters an obstacle it will execute another function that will attempt to access the food. If the access attempts or the time threshold is greater than the limit defined in the function the fly gives up. I don't think the fly actually "thinks". I'd imagine it's encoded into the fly. Perhaps an experiment could be to get a group of flies and record them and see if flies try to access the food behind the mesh an equal number of times.