Closed nervgh closed 6 years ago
Sometimes SimulatedAnnealing#getRandomState() generates number which is out of range. It happens because that method generates numbers inclusive. And we have as follows:
// this.states = [0...99] // this.getRandomState() --> [0..100] let diff = undefined - this.states[this.current];
https://github.com/aimacode/aima-javascript/blob/master/4-Beyond-Classical-Search/simulatedAnnealing.js#L11
Thank you!
Sometimes SimulatedAnnealing#getRandomState() generates number which is out of range. It happens because that method generates numbers inclusive. And we have as follows:
https://github.com/aimacode/aima-javascript/blob/master/4-Beyond-Classical-Search/simulatedAnnealing.js#L11