Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in resign logic #102

Merged
merged 10 commits into from Mar 12, 2015
Merged

Fix bug in resign logic #102

merged 10 commits into from Mar 12, 2015

Conversation

ujh
Copy link
Owner

@ujh ujh commented Mar 11, 2015

The bot lost against Brown (random player) as it resigned when all
simulated moves lead to a loss. At the end of the game this can however
happen when the only possible moves are plays in the opponents eyes.

So now we only resign if both all simulations lead to a loss and playing
a pass move would lead to a loss.

@TisButMe
Copy link
Collaborator

It looks like the build is failing because its using an older version of regex, but it looks fixed in the last master. Manually triggering a re-build should make the error go away.

@ujh
Copy link
Owner Author

ujh commented Mar 11, 2015

Actually, I think my fix is wrong. :) I'll investigate further later. I believe it's a but in the AmafEngine code.

The bot lost against Brown (random player) as it resigned when all
simulated moves lead to a loss. At the end of the game this can however
happen when the only possible moves are plays in the opponents eyes.

So now we only resign if both all simulations lead to a loss and playing
a pass move would lead to a loss.
@ujh
Copy link
Owner Author

ujh commented Mar 12, 2015

OK, here's the real fix. It turns out that the AmafEngine didn't even record if the first move in a playout (i.e. the one selected to be simulated by the engine) was a win or a loss. It's no wonder that the results were bad! Or rather, it's a testament to the (comparative) strength of the AMAF heuristic that this was even stronger than pure Monte Carlo.

@ujh
Copy link
Owner Author

ujh commented Mar 12, 2015

And I'm done I think. The actual playing of the random games is now in the constructor of Playout as it always seemed weird that you had to call new and then run.

Please have a look again @TisButMe and @iopq.

@TisButMe
Copy link
Collaborator

Looks fine, but I wonder if keeping the name Playout::new instead of Playout::run is better ? The somewhat implicit contract of new is that it'll only instantiate some object. Here we do some serious work, maybe it'd be better to switch the name over ?

@ujh
Copy link
Owner Author

ujh commented Mar 12, 2015

That is true, of course!

ujh added a commit that referenced this pull request Mar 12, 2015
@ujh ujh merged commit f01ae60 into master Mar 12, 2015
@ujh ujh deleted the fix-resign-bug branch March 12, 2015 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants