MCPcopy
hub / github.com/tensorflow/tfjs-examples / reset

Method reset

snake-dqn/snake_game.js:96–101  ·  view source on GitHub ↗

* Reset the state of the game. * * @return {object} Initial state of the game. * See the documentation of `getState()` for details.

()

Source from the content-addressed store, hash-verified

94 * See the documentation of `getState()` for details.
95 */
96 reset() {
97 this.initializeSnake_();
98 this.fruitSquares_ = null;
99 this.makeFruits_();
100 return this.getState();
101 }
102
103 /**
104 * Perform a step of the game.

Callers 5

constructorMethod · 0.95
snake_game_test.jsFile · 0.45
resetFunction · 0.45
agent_test.jsFile · 0.45

Calls 3

initializeSnake_Method · 0.95
makeFruits_Method · 0.95
getStateMethod · 0.95

Tested by

no test coverage detected