summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Fultz <jfultz@wolfram.com>2019-08-06 08:58:52 -0500
committerJohn Fultz <jfultz@wolfram.com>2019-08-06 08:58:52 -0500
commitb50b9077ef61b71d9c0e66c3165198a7ab9a5672 (patch)
tree57e6f4c9bc8469289d43ed539613e48ac4586c74
parent7d652051546a69f684cfea15c96c85a07391b0ee (diff)
Fix regression in simulator.
When I refactored the simming loop in Simulator::simulateOnePosition() using a ranged for, I mis-translated the value of the playerNumber variable. This resulted in the results of some plays being double-weighted. This fixes a bug where a 2-ply sim on the opening rack ACINPU? will favor non-bingo plays like UP or CUP rather than bingo plays like PANICUm or PUrANIC. The Championship Player uses a 2-ply sim, so the Championship Player could make some bone-headed plays with this regression.
-rw-r--r--sim.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/sim.cpp b/sim.cpp
index 912ceb5..30ccc3d 100644
--- a/sim.cpp
+++ b/sim.cpp
@@ -352,7 +352,7 @@ void Simulator::simulateOnePosition(SimmedMoveMessage &message, const SimmedMove
(*levelIt).setNumberScores(decimal);
- int playerNumber = 1;
+ int playerNumber = 0;
for (auto &scoresIt : (*levelIt).statistics)
{
if (game.currentPosition().gameOver())