~bonbon/gmcts

988d28159051f5d250b2b7b50676e10eaed21e41 — bonbon 1 year, 6 months ago 54cb301 v1.2.0
add SetSeed method on MCTS type
1 files changed, 9 insertions(+), 0 deletions(-)

M mcts.go
M mcts.go => mcts.go +9 -0
@@ 39,6 39,15 @@ func (m *MCTS) SpawnTree() *Tree {
	return m.SpawnCustomTree(DefaultExplorationConst)
}

//SetSeed sets the seed of the next tree to be spawned.
//This value is initially set to 1, and increments on each
//spawned tree.
func (m *MCTS) SetSeed(seed int64) {
	m.mutex.Lock()
	defer m.mutex.Unlock()
	m.seed = seed
}

//SpawnCustomTree creates a new search tree with a given exploration constant.
func (m *MCTS) SpawnCustomTree(explorationConst float64) *Tree {
	m.mutex.Lock()