xhash: Create Hash Table for Generic Keys

Description Usage Arguments Value

Description

Create Hash Table for Generic Keys

Usage

1
2
xhash(convfunc = function(state, ...) state, convfunc_vec = function(states,
  ...) unlist(Map(convfunc, states, ...)), default_value = NULL)

Arguments

convfunc

function that converts a game state to a key. It must take a positional argument state and keyword arguments represented by ..., and returns a character.

convfunc_vec

function for vectorized conversion from states to keys. This function must receive a positional argument states and keyword arguments ... and returns character vector. By default, it tries to vectorize convfunc using Map. User may specify more efficient function if any.

default_value

value to be returned when a state is not recorded in the table.

Value

xhash object


tictactoe documentation built on May 2, 2019, 2:54 a.m.