in simple_game/cfr_opt.h [40:62]
void purifyStrategy() {
if (isChancePlayer_)
return;
if (numAction_ == 0) {
// std::cout << "#actions = 0! infoSet = " << key_ << std::endl;
return;
}
// compute argmax.
float maxProb = -1.0f;
int maxAction = 0;
for (int i = 0; i < numAction_; ++i) {
if (maxProb < strategy_[i]) {
maxProb = strategy_[i];
maxAction = i;
}
}
assert(maxAction >= 0 && maxAction < numAction_);
std::fill(strategy_.begin(), strategy_.end(), 0.0f);
strategy_[maxAction] = 1.0f;
}