src/mp_vcfr_2017.cpp
// Same as VCFR implementation; should share
Same as VCFR implementation; should share
Same as VCFR implementation ; should share
void MPVCFR::SetStreetBuckets(int st, int gbd, int **street_buckets) {
  if (buckets_.None(st)) return;
  int num_board_cards = Game::NumBoardCards(st);
  const Card *board = BoardTree::Board(st, gbd);
  Card cards[7];
  for (int i = 0; i < num_board_cards; ++i) {
    cards[i + 2] = board[i];
  }
  int lbd = gbd;
  const CanonicalCards *hands = hand_tree_->Hands(st, lbd);
  int max_street = Game::MaxStreet();
  int num_hole_card_pairs = Game::NumHoleCardPairs(st);
  for (int i = 0; i < num_hole_card_pairs; ++i) {
    int h;
    if (st == max_street) {
      const Card *hole_cards = hands->Cards(i);
      cards[0] = hole_cards[0];
      cards[1] = hole_cards[1];
      int hcp = HCPIndex(st, cards);
      h = gbd * num_hole_card_pairs + hcp;
    } else {
      h = gbd * num_hole_card_pairs + i;
    }
    street_buckets[st][i] = buckets_.Bucket(st, h);
  }
}
void MPVCFR :: SetStreetBuckets ( int st , int gbd , int * * street_buckets ) { if ( buckets_ . None ( st ) ) return ; int num_board_cards = Game :: NumBoardCards ( st ) ; const Card * board = BoardTree :: Board ( st , gbd ) ; Card cards [ 7 ] ; for ( int i = 0 ; i < num_board_cards ; ++ i ) { cards [ i + 2 ] = board [ i ] ; } int lbd = gbd ; const CanonicalCards * hands = hand_tree_ -> Hands ( st , lbd ) ; int max_street = Game :: MaxStreet ( ) ; int num_hole_card_pairs = Game :: NumHoleCardPairs ( st ) ; for ( int i = 0 ; i < num_hole_card_pairs ; ++ i ) { int h ; if ( st == max_street ) { const Card * hole_cards = hands -> Cards ( i ) ; cards [ 0 ] = hole_cards [ 0 ] ; cards [ 1 ] = hole_cards [ 1 ] ; int hcp = HCPIndex ( st , cards ) ; h = gbd * num_hole_card_pairs + hcp ; } else { h = gbd * num_hole_card_pairs + i ; } street_buckets [ st ] [ i ] = buckets_ . Bucket ( st , h ) ; } }
Same as VCFR implementation; should share
Same as VCFR implementation ; should share
// Assume root_bd_st_ == 0 // Hands on final street were reordered by hand strength, but // bucket lookup requires the unordered hole card pair index