generated from michael/webpack-base
add a small stat
This commit is contained in:
parent
a69af98250
commit
f2c2e6d86b
@ -17,6 +17,7 @@ import {
|
||||
resetGlobalIDs,
|
||||
} from './neat';
|
||||
import { BASE_GENOME_SNAKE_BRAIN_NEAT, NEATSnakeBrain } from './neat-snake-brain';
|
||||
import { mapInvert, mapMap } from './util';
|
||||
|
||||
const BOARD_SIZE = 600; // px
|
||||
const SQUARE_SIZE = 30; // px
|
||||
@ -216,6 +217,7 @@ export default function runCanvas(canvas: HTMLCanvasElement, pipeRef: MutableRef
|
||||
const { nextPopulation, nextReps } = computeNextGeneration(population, fitness, NGC);
|
||||
population = nextPopulation;
|
||||
reps = nextReps;
|
||||
console.log({ nextPopulationSizes: mapMap(mapInvert(nextPopulation), (k, v) => [k, v.size]) });
|
||||
trainer = {
|
||||
labs: Array.from(population.keys()).map(g => makeLab(nextLabId++, g)),
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user