src/subgame_utils.cpp
// More flexible implementation that supports subtrees not rooted at street-initial node.
// Don't really need to know num_bets.
// We do need to know num_street_bets.  Determines whether we can fold.
// I think we need num_players_to_act.  Should be 2 at street initial node, and 1 otherwise.
// Only support heads-up for now.  Assume no one has folded.
More flexible implementation that supports subtrees not rooted at street-initial node.
Don't really need to know num_bets.
We do need to know num_street_bets.  Determines whether we can fold.
I think we need num_players_to_act.  Should be 2 at street initial node, and 1 otherwise.
Only support heads-up for now.  Assume no one has folded.
More flexible implementation that supports subtrees not rooted at street - initial node . Don ' t really need to know num_bets . We do need to know num_street_bets . Determines whether we can fold . I think we need num_players_to_act . Should be 2 at street initial node and 1 otherwise . Only support heads - up for now . Assume no one has folded .
BettingTrees *CreateSubtrees(int st, int last_bet_size, int last_bet_to, int num_street_bets,
			     int num_bets, int player_acting, int num_players_to_act,
			     int target_player, const BettingAbstraction &betting_abstraction) {
  int num_players = Game::NumPlayers();
  unique_ptr<bool []> folded(new bool[num_players]);
  for (int p = 0; p < num_players; ++p) folded[p] = false;
  string key;
  int num_terminals = 0;
  BettingTreeBuilder betting_tree_builder(betting_abstraction, target_player);
  shared_ptr<Node> subtree_root =
    betting_tree_builder.CreateMPSubtree(st, last_bet_size, last_bet_to, num_street_bets,
					 num_bets, player_acting, num_players_to_act,
					 folded.get(), target_player, &key, &num_terminals);
  return new BettingTrees(subtree_root.get());
}
BettingTrees * CreateSubtrees ( int st , int last_bet_size , int last_bet_to , int num_street_bets , int num_bets , int player_acting , int num_players_to_act , int target_player , const BettingAbstraction & betting_abstraction ) { int num_players = Game :: NumPlayers ( ) ; unique_ptr < bool [ ] > folded ( new bool [ num_players ] ) ; for ( int p = 0 ; p < num_players ; ++ p ) folded [ p ] = false ; string key ; int num_terminals = 0 ; BettingTreeBuilder betting_tree_builder ( betting_abstraction , target_player ) ; shared_ptr < Node > subtree_root = betting_tree_builder . CreateMPSubtree ( st , last_bet_size , last_bet_to , num_street_bets , num_bets , player_acting , num_players_to_act , folded . get ( ) , target_player , & key , & num_terminals ) ; return new BettingTrees ( subtree_root . get ( ) ) ; }
More flexible implementation that supports subtrees not rooted at street-initial node.
More flexible implementation that supports subtrees not rooted at street - initial node .