src/cfr_utils.cpp
// Abstracted, double regrets
// This implementation does not round regrets to ints, nor do scaling.
// No flooring here.  Will be done later.
Abstracted, double regrets
This implementation does not round regrets to ints, nor do scaling.
No flooring here.  Will be done later.
Abstracted double regrets This implementation does not round regrets to ints nor do scaling . No flooring here . Will be done later .
void VCFR::UpdateRegretsBucketed(Node *node, int **street_buckets, double *vals, double **succ_vals,
				 double *regrets) {
  int st = node->Street();
  int num_succs = node->NumSuccs();
  int num_hole_card_pairs = Game::NumHoleCardPairs(st);
  double ceiling = regret_ceilings_[st];
  if (nn_regrets_) {
    for (int i = 0; i < num_hole_card_pairs; ++i) {
      int b = street_buckets[st][i];
      double *my_regrets = regrets + b * num_succs;
      for (int s = 0; s < num_succs; ++s) {
	double newr = my_regrets[s] + succ_vals[s][i] - vals[i];
	if (newr > ceiling) {
	  my_regrets[s] = ceiling;
	} else {
	  my_regrets[s] = newr;
	}
      }
    }
  } else {
    for (int i = 0; i < num_hole_card_pairs; ++i) {
      int b = street_buckets[st][i];
      double *my_regrets = regrets + b * num_succs;
      for (int s = 0; s < num_succs; ++s) {
	my_regrets[s] += succ_vals[s][i] - vals[i];
      }
    }
  }
}
void VCFR :: UpdateRegretsBucketed ( Node * node , int * * street_buckets , double * vals , double * * succ_vals , double * regrets ) { int st = node -> Street ( ) ; int num_succs = node -> NumSuccs ( ) ; int num_hole_card_pairs = Game :: NumHoleCardPairs ( st ) ; double ceiling = regret_ceilings_ [ st ] ; if ( nn_regrets_ ) { for ( int i = 0 ; i < num_hole_card_pairs ; ++ i ) { int b = street_buckets [ st ] [ i ] ; double * my_regrets = regrets + b * num_succs ; for ( int s = 0 ; s < num_succs ; ++ s ) { double newr = my_regrets [ s ] + succ_vals [ s ] [ i ] - vals [ i ] ; if ( newr > ceiling ) { my_regrets [ s ] = ceiling ; } else { my_regrets [ s ] = newr ; } } } } else { for ( int i = 0 ; i < num_hole_card_pairs ; ++ i ) { int b = street_buckets [ st ] [ i ] ; double * my_regrets = regrets + b * num_succs ; for ( int s = 0 ; s < num_succs ; ++ s ) { my_regrets [ s ] += succ_vals [ s ] [ i ] - vals [ i ] ; } } } }
Abstracted, double regrets
This implementation does not round regrets to ints, nor do scaling.
Abstracted double regrets This implementation does not round regrets to ints nor do scaling .