Add self driving car app

This commit is contained in:
Peter Stockings
2026-01-15 18:13:48 +11:00
parent dd561a4b32
commit fab6a7e03f
8 changed files with 344 additions and 99 deletions

View File

@@ -59,8 +59,8 @@ export class SimpleGA {
// 3. Fill rest
while (nextPop.length < popSize) {
// Diversity Injection (Random Immigrants)
// 5% chance to just insert a completely fresh brain to maintain diversity
if (Math.random() < 0.05) {
// Increased from 5% to 15% to combat stagnation
if (Math.random() < 0.15) {
const dn = new DenseNetwork(this.layerSizes);
nextPop.push(dn.getWeights());
continue;