ast_toolbox.mcts.RNGWrapper module

class ast_toolbox.mcts.RNGWrapper.RSG(state_length=1, seed=0)[source]

Bases: object

The random seed generator for AST using random seeds.

Parameters:
  • state_length (int, optional) – The length of the RSG state.
  • seed (int, optional) – The initial seed to generate the initial state.
length()[source]

Return the length of the RSG state.

Returns:length (int) – The length of the RSG state.
next()[source]

Step the RSG state.

set_from_seed(length, seed)[source]

Set the RSG state using the seed.

Parameters:
  • length (int) – The length of the RSG state.
  • seed (int) – The seed to generate the state.
ast_toolbox.mcts.RNGWrapper.seed_to_state_itr(state_length, seed)[source]

Generate the RSG state using the seed.

Parameters:
  • state_length (int) – The length of the RSG state.
  • seed (int) – The seed to generate the state.
Returns:

state (numpy.ndarry) – The generated state.