pbsinclair42 / MCTS

A simple package to allow users to run Monte Carlo Tree Search on any perfect information domain

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AttributeError: 'NoneType' object has no attribute 'state'

CreamyLong opened this issue · comments

Hi, Thanks for your great work. When I run your example NaughtsAndCrossesState, I get the info that is AttributeError: 'NoneType' object has no attribute 'state'

I found that when I set timeLimit or iterationLimit low the program was ok, but when the values are high the error comes out

This is because he uses the same name for class mcts and the object mcts.

mcts = mcts(timeLimit=1000)
bestAction = mcts.search(initialState=initialState)

Change it into

searcher = mcts(timeLimit=1000)
action = searcher.search(initialState=initialState)

will solve this issue. I also correct this in pull request #13.