src/run_approx_rgbr.cpp
// For multithreading purposes: create child PreResponder from a parent PreResponder
For multithreading purposes: create child PreResponder from a parent PreResponder
For multithreading purposes : create child PreResponder from a parent PreResponder
PreResponder::PreResponder(const CardAbstraction &ca, const BettingAbstraction &ba,
			   const CFRConfig &cc, const Buckets &buckets, int street, bool resolve,
			   const CardAbstraction &s_ca, const BettingAbstraction &s_ba,
			   const CFRConfig &s_cc, const Buckets &subgame_buckets,
			   int num_resolve_its, int responder_p, shared_ptr<CFRValues> sumprobs,
			   bool use_subgames, shared_ptr<HandTree> trunk_hand_tree,
			   shared_ptr<int []> board_samples,
			   shared_ptr<unique_ptr<bool []> []> has_continuation, int num_threads,
			   int thread_index, Node *p0_node, Node *p1_node, int pbd,
			   const string &action_sequence, const ReachProbs *reach_probs) :
  card_abstraction_(ca), betting_abstraction_(ba), cfr_config_(cc), buckets_(buckets),
  street_(street), resolve_(resolve), subgame_card_abstraction_(s_ca),
  subgame_betting_abstraction_(s_ba), subgame_cfr_config_(s_cc), subgame_buckets_(subgame_buckets),
  num_resolve_its_(num_resolve_its), responder_p_(responder_p), sumprobs_(sumprobs),
  use_subgames_(use_subgames), trunk_hand_tree_(trunk_hand_tree), board_samples_(board_samples),
  has_continuation_(has_continuation), num_threads_(num_threads), thread_index_(thread_index),
  p0_node_(p0_node), p1_node_(p1_node), pbd_(pbd), action_sequence_(action_sequence),
  reach_probs_(reach_probs)  {
  int max_street = Game::MaxStreet();
  int max_num_hole_card_pairs = Game::NumHoleCardPairs(0);
  int num = (max_street + 1) * max_num_hole_card_pairs;
  street_buckets_.reset(new int[num]);
  if (resolve_) {
    eg_cfr_.reset(new UnsafeEGCFR(s_ca, ca, ba, s_cc, cc, subgame_buckets_, 1));
  } else {
    vcfr_.reset(new VCFR(ca, cc, buckets, 1));
    vcfr_->SetValueCalculation(true);
    for (int st = street_; st <= max_street; ++st) {
      vcfr_->SetBestResponseStreet(st, true);
    }
    vcfr_->SetSumprobs(sumprobs_);
  }
  num_resolves_ = 0;
  resolving_secs_ = 0;
}
PreResponder :: PreResponder ( const CardAbstraction & ca , const BettingAbstraction & ba , const CFRConfig & cc , const Buckets & buckets , int street , bool resolve , const CardAbstraction & s_ca , const BettingAbstraction & s_ba , const CFRConfig & s_cc , const Buckets & subgame_buckets , int num_resolve_its , int responder_p , shared_ptr < CFRValues > sumprobs , bool use_subgames , shared_ptr < HandTree > trunk_hand_tree , shared_ptr < int [ ] > board_samples , shared_ptr < unique_ptr < bool [ ] > [ ] > has_continuation , int num_threads , int thread_index , Node * p0_node , Node * p1_node , int pbd , const string & action_sequence , const ReachProbs * reach_probs ) : card_abstraction_ ( ca ) , betting_abstraction_ ( ba ) , cfr_config_ ( cc ) , buckets_ ( buckets ) , street_ ( street ) , resolve_ ( resolve ) , subgame_card_abstraction_ ( s_ca ) , subgame_betting_abstraction_ ( s_ba ) , subgame_cfr_config_ ( s_cc ) , subgame_buckets_ ( subgame_buckets ) , num_resolve_its_ ( num_resolve_its ) , responder_p_ ( responder_p ) , sumprobs_ ( sumprobs ) , use_subgames_ ( use_subgames ) , trunk_hand_tree_ ( trunk_hand_tree ) , board_samples_ ( board_samples ) , has_continuation_ ( has_continuation ) , num_threads_ ( num_threads ) , thread_index_ ( thread_index ) , p0_node_ ( p0_node ) , p1_node_ ( p1_node ) , pbd_ ( pbd ) , action_sequence_ ( action_sequence ) , reach_probs_ ( reach_probs ) { int max_street = Game :: MaxStreet ( ) ; int max_num_hole_card_pairs = Game :: NumHoleCardPairs ( 0 ) ; int num = ( max_street + 1 ) * max_num_hole_card_pairs ; street_buckets_ . reset ( new int [ num ] ) ; if ( resolve_ ) { eg_cfr_ . reset ( new UnsafeEGCFR ( s_ca , ca , ba , s_cc , cc , subgame_buckets_ , 1 ) ) ; } else { vcfr_ . reset ( new VCFR ( ca , cc , buckets , 1 ) ) ; vcfr_ -> SetValueCalculation ( true ) ; for ( int st = street_ ; st <= max_street ; ++ st ) { vcfr_ -> SetBestResponseStreet ( st , true ) ; } vcfr_ -> SetSumprobs ( sumprobs_ ) ; } num_resolves_ = 0 ; resolving_secs_ = 0 ; }
For multithreading purposes: create child PreResponder from a parent PreResponder
For multithreading purposes : create child PreResponder from a parent PreResponder