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

Function getRandomAction

snake-dqn/snake_game.js:45–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

43 * @return {0 | 1 | 2} Action represented as a number.
44 */
45export function getRandomAction() {
46 return getRandomInteger(0, NUM_ACTIONS);
47}
48
49export class SnakeGame {
50 /**

Callers 2

snake_game_test.jsFile · 0.90
playStepMethod · 0.90

Calls 1

getRandomIntegerFunction · 0.90

Tested by

no test coverage detected