Author | Message |
---|---|
rabbott
Posts: 1649
|
Posted 22:24 Mar 05, 2020 |
In the demonstration of flocking I showed today, everything wrapped around. There was no bounce option. (That's because bounce didn't work properly in the flocking application, and I just prevented it from being used.) But it's now fixed -- and is on by default. (You have to download the current versions of agent.py and flocking.py.) So you will see the flocks bouncing off the screen edges, and the flockmate links (if turned on) don't stretch across the screen. You can play this game with a flock. Turn bounce off. Let a portion of a flock wrap around and turn bounce back on when part of a flock has wrapped around and the other part hasn't reached the screen edge. This will split the flock into two separate subflocks, which are no longer connected related. |
rabbott
Posts: 1649
|
Posted 11:54 Mar 06, 2020 |
Flocking with bounce turned on illustrates one of the evolutionary benefits of flocking. Notice that the edge of a flock that encounters a screen edge turns away first (as expected). The other flock members are pulled away from the edge by the action of their flockmates who turned away from it. If the screen edge were danger of some sort, the entire flock has an extended view of the world in that the flock edges can see the danger first and direct the rest of the flock away. To see this keep your eye on one of the flock members that is not at the edge of a flock about to encounter a screen edge and watch how it moves as it's flockmates turn away from the edge. |