(size, randomiseInstructions = true)
| 25 | class Brain { |
| 26 | |
| 27 | constructor(size, randomiseInstructions = true) { |
| 28 | this.instructions = []; |
| 29 | this.currentInstructionNumber = 0; |
| 30 | if (randomiseInstructions) |
| 31 | this.randomize(size); |
| 32 | this.parentReachedBestLevelAtActionNo = 0; |
| 33 | } |
| 34 | |
| 35 | randomize(size) { |
| 36 | for (let i = 0; i < size; i++) { |