Info
This post was imported from a personal note. It may contain inside jokes, streams of consciousness, errors, and other nonsense.
I forgot it while factoring out my random number methods into a utility class. The error message you get are pretty unhelpful.
syntax error 'using'
From a file that includes the .hpp file in question. This was another one that popped up.
constructors not allowed a return type
Never forget.
Interpreting another group of boids:
Generation: 79
Steps: 1510
Fitness scores, weights:
7 1.00 -0.89 -0.06 0.61 -0.69 0.81
3 0.92 -1.00 -0.03 0.70 -0.75 0.92
3 0.98 -0.85 -0.00 0.57 -0.66 0.84
3 0.90 -0.04 -0.33 0.73 -0.91 0.81
3 1.00 -0.78 0.06 0.64 -0.57 0.67
2 0.95 -0.73 0.07 0.51 -0.73 0.75
1 0.96 -0.04 -0.27 0.68 -0.81 0.86
1 0.96 -0.89 0.11 0.79 -0.85 0.62
1 1.00 -1.00 0.07 0.70 -0.79 0.54
0 0.95 -1.00 -0.08 0.73 -0.64 0.85
w0 (bias to speed) - very positive, ~1.0 - go fast w1 (bias to turn) - very negative, -0.7 to -1.0 - turn left by default w2 (food detect to speed) - maybe negative, 0.0 to -0.3 - maybe slow down a little as it nears food w3 (food detect to turn) - positive, around 0.6 to 0.7 - turn right faster as it nears food w4 (food direction to speed) - negative, -0.6 to -0.9 - speed up if food is on left, slow down if on right w5 (food direction to turn) - positive, 0.6 to 0.9 - turn toward food
Turn left by default (w1) and then turn right more and more when food is detected (w3). Together these should make it go straight as food gets closer. In combination with turn toward food (w5), overall it’ll turn toward food.
If food is on the left speed up is weird. Watching them, the boids do seem to steer toward food, though they can waver on the approach. Also interesting that doing a hard left turn by default is the norm but then they live in a target rich environment so it probably doesn’t come into play on its own, but rather in conjunction with the turning behaviour when food is detected.
I bet things work differently if it only detects food in front of it.
Trying 100 generations. Run time on each attempt was 53s, 55s… and I just ran one that took 190 seconds. These things would never survive in the wild. Look at them:
Generation: 101
Steps: 2638
Fitness scores, weights:
5 0.16 -0.09 0.89 0.99 0.25 0.72
4 0.37 -0.28 1.00 0.74 -0.37 0.28
3 0.10 -0.07 0.90 0.91 0.23 0.86
3 0.22 -0.33 0.84 0.77 -0.38 0.30
3 0.02 0.07 0.98 0.94 0.19 0.79
3 0.26 -0.23 0.85 0.72 -0.41 0.32
2 0.27 -0.27 0.98 0.78 -0.42 0.23
2 0.05 0.09 0.85 1.00 0.14 0.80
1 0.12 -0.04 0.78 1.00 0.17 0.80
1 0.28 -0.30 0.86 0.72 -0.42 0.36
They move slowly by default and have developed only a weak tendency to turn toward food. After 100 generations. Wowsers.
There’s an interesting behaviour where some of them will slow down while the food is on the left. So they’ll end up stopped and spinning until the food crosses the center line behind them and then they start moving again. That’s kinda interesting. I think it _does_ work for going back and fetching food that they’ve nearly passed by.
Check out the two blue boids near the center exhibiting that behaviour, though not exactly with any success.
In fact, most of them seem to be steering away from food. It’s kinda infuriating to watch. =\