in simple_game/search.h [1788:1823]
ResultAgg _bruteforceSearch(const std::vector<Entry>& prefix,
const InfoSets& infoSets,
int playerIdx,
Analysis* analysis) {
// choose possible actions and set the policy accordingly
if (analysis != nullptr) {
dumpReachability(prefix, infoSets, analysis);
}
ResultAgg res;
for (const auto& infoSet : infoSets) {
assert(!infoSet->isChance());
auto strategy = infoSet->strategy();
for (int a = 0; a < infoSet->numAction(); ++a) {
// Set to delta strategy.
auto currAction = std::make_pair(infoSet->key(), a);
infoSet->setDeltaStrategy(a);
auto prefix2 = prefix;
prefix2.push_back(currAction);
// recurse its children.
auto thisRes =
_bruteforceSearch(prefix2, infoSet->succ(a), playerIdx, analysis);
res.append(thisRes.attach(currAction, 0));
}
// Resume old strategy.
infoSet->setStrategy(strategy);
}
// Evaluate current policy.
evaluate();
res.append(Result(root_->u()[playerIdx]));
return res;
}