MCPcopy Create free account
hub / github.com/Code-Bullet/Jump-King / constructor

Method constructor

Population.js:7–27  ·  view source on GitHub ↗
(size)

Source from the content-addressed store, hash-verified

5class Population {
6
7 constructor(size) {
8 this.popSize = size;
9 this.players = [];
10 for (let i = 0; i < size; i++) {
11 this.players.push(new Player());
12 }
13
14 this.showingFail = false;
15 this.failPlayerNo = 0;
16 this.bestPlayerIndex = 0;
17 this.currentHighestPlayerIndex = 0;
18 this.fitnessSum = 0;
19 this.gen = 1;
20 this.bestHeight = 0;
21 this.showingLevelNo = 0;
22 this.currentBestLevelReached = 0;
23 this.purgeTheSlackers = false;
24 this.reachedBestLevelAtActionNo = 0;
25 this.newLevelReached = false;
26 this.cloneOfBestPlayerFromPreviousGeneration = this.players[0].clone();
27 }
28
29 Update() {
30 for (let i = 0; i < this.players.length; i++) {

Callers

nothing calls this directly

Calls 1

cloneMethod · 0.45

Tested by

no test coverage detected