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

add randomization to same-score move selection #38

Open
danlangford opened this issue Jun 2, 2023 · 1 comment
Open

add randomization to same-score move selection #38

danlangford opened this issue Jun 2, 2023 · 1 comment

Comments

@danlangford
Copy link
Collaborator

from #32 @pappde notes the following

right now if two moves have the same "score", it picks the first one.

  	if (t.score[i] > t.best_score)
  		t.SetBestMove(attack, t.score[i]);

You could add some randomization to select from multiple moves that have the same score (which may be 0).

@pappde
Copy link
Owner

pappde commented Jun 3, 2023

This is low priority, since it will typically only occur in edge cases where it probably doesn't matter anyways.

Currently, there is bias for the first move. There are two approaches that could be taken to reduce the bias:
A) low-cost add a simple tweakable probability (e.g. a 50% rand check). This would be "fair" if there were two moves, and otherwise would bias the later moves
B) build a list of moves that match the score, then randomly select from that list

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

No branches or pull requests

2 participants