src/subgame_utils.cpp
// I always load probabilities for both players because I need the reach
// probabilities for both players.  In addition, as long as we are
// zero-summing the T-values, we need the strategy for both players for the
// CBR computation.
// Actually: for normal subgame solving, I think I only need both players'
// strategies if we are zero-summing.
I always load probabilities for both players because I need the reach
probabilities for both players.  In addition, as long as we are
zero-summing the T-values, we need the strategy for both players for the
CBR computation.
Actually: for normal subgame solving, I think I only need both players'
strategies if we are zero-summing.
I always load probabilities for both players because I need the reach probabilities for both players . In addition as long as we are zero - summing the T - values we need the strategy for both players for the CBR computation . Actually : for normal subgame solving I think I only need both players ' strategies if we are zero - summing .
unique_ptr<CFRValues> ReadBaseSubgameStrategy(const CardAbstraction &base_card_abstraction,
					      const BettingAbstraction &base_betting_abstraction,
					      const CFRConfig &base_cfr_config,
					      const BettingTrees *base_betting_trees,
					      const Buckets &base_buckets,
					      const Buckets &subgame_buckets, int base_it,
					      Node *base_node, int gbd,
					      const string &action_sequence, double **reach_probs,
					      BettingTree *subtree, bool current, int asym_p) {
  int max_street = Game::MaxStreet();
  unique_ptr<bool []> subgame_streets(new bool[max_street + 1]);
  for (int st = 0; st <= max_street; ++st) {
    subgame_streets[st] = st >= base_node->Street();
  }
  unique_ptr<CFRValues> strategy(new CFRValues(nullptr, subgame_streets.get(),
					       gbd, base_node->Street(), base_buckets,
					       base_betting_trees->GetBettingTree()));
  char dir[500];
  sprintf(dir, "%s/%s.%u.%s.%i.%i.%i.%s.%s", Files::OldCFRBase(),
	  Game::GameName().c_str(), Game::NumPlayers(),
	  base_card_abstraction.CardAbstractionName().c_str(),
	  Game::NumRanks(),
	  Game::NumSuits(), Game::MaxStreet(),
	  base_betting_abstraction.BettingAbstractionName().c_str(),
	  base_cfr_config.CFRConfigName().c_str());
  if (base_betting_abstraction.Asymmetric()) {
    char buf[100];
    sprintf(buf, ".p%u", asym_p);
    strcat(dir, buf);
  }
  unique_ptr<int []> num_full_holdings(new int[max_street + 1]);
  for (int st = 0; st <= max_street; ++st) {
    if (subgame_buckets.None(st)) {
      num_full_holdings[st] =
	BoardTree::NumBoards(st) * Game::NumHoleCardPairs(st);
    } else {
      num_full_holdings[st] = subgame_buckets.NumBuckets(st);
    }
  }
  fprintf(stderr, "Need to implement ReadSubtreeFromFull()\n");
  exit(-1);
#if 0
  strategy->ReadSubtreeFromFull(dir, base_it, base_betting_trees->Root(),
				base_node, subtree->Root(), action_sequence,
				num_full_holdings.get(), -1);
#endif
  return strategy;
}
unique_ptr < CFRValues > ReadBaseSubgameStrategy ( const CardAbstraction & base_card_abstraction , const BettingAbstraction & base_betting_abstraction , const CFRConfig & base_cfr_config , const BettingTrees * base_betting_trees , const Buckets & base_buckets , const Buckets & subgame_buckets , int base_it , Node * base_node , int gbd , const string & action_sequence , double * * reach_probs , BettingTree * subtree , bool current , int asym_p ) { int max_street = Game :: MaxStreet ( ) ; unique_ptr < bool [ ] > subgame_streets ( new bool [ max_street + 1 ] ) ; for ( int st = 0 ; st <= max_street ; ++ st ) { subgame_streets [ st ] = st >= base_node -> Street ( ) ; } unique_ptr < CFRValues > strategy ( new CFRValues ( nullptr , subgame_streets . get ( ) , gbd , base_node -> Street ( ) , base_buckets , base_betting_trees -> GetBettingTree ( ) ) ) ; char dir [ 500 ] ; sprintf ( dir , " " , Files :: OldCFRBase ( ) , Game :: GameName ( ) . c_str ( ) , Game :: NumPlayers ( ) , base_card_abstraction . CardAbstractionName ( ) . c_str ( ) , Game :: NumRanks ( ) , Game :: NumSuits ( ) , Game :: MaxStreet ( ) , base_betting_abstraction . BettingAbstractionName ( ) . c_str ( ) , base_cfr_config . CFRConfigName ( ) . c_str ( ) ) ; if ( base_betting_abstraction . Asymmetric ( ) ) { char buf [ 100 ] ; sprintf ( buf , " " , asym_p ) ; strcat ( dir , buf ) ; } unique_ptr < int [ ] > num_full_holdings ( new int [ max_street + 1 ] ) ; for ( int st = 0 ; st <= max_street ; ++ st ) { if ( subgame_buckets . None ( st ) ) { num_full_holdings [ st ] = BoardTree :: NumBoards ( st ) * Game :: NumHoleCardPairs ( st ) ; } else { num_full_holdings [ st ] = subgame_buckets . NumBuckets ( st ) ; } } fprintf ( stderr , " \n " ) ; exit ( -1 ) ; #if 0 strategy -> ReadSubtreeFromFull ( dir , base_it , base_betting_trees -> Root ( ) , base_node , subtree -> Root ( ) , action_sequence , num_full_holdings . get ( ) , -1 ) ; #endif return strategy ; }
I always load probabilities for both players because I need the reach
probabilities for both players.
I always load probabilities for both players because I need the reach probabilities for both players .
// We need probs for subgame streets only