whatsdis / pluribus

Implementation of Pluribus by Noam Brown & Tuomas Sandholm, a Superhuman AI for 6-MAX No-Limit Holdem Poker Bot.
https://science.sciencemag.org/highwire/filestream/728919/field_highwire_adjunct_files/0/aay2400-Brown-SM.pdf
215 stars 50 forks source link

implement getActionsFromInfoSet #3

Open whatsdis opened 4 years ago

whatsdis commented 4 years ago

Relevant bit from @EAT-CODE-KITE-REPEAT:

getActionsFromInfoSet should do the exact thing as it's called. From the infoSet it should get a set of possible actions at that moment so it can iterate over those in the beginning of the script. Depending on how infoSet is implemented this is possible OR NOT, I think currently there is a problem and can't be implented yet because of the implementation of an infoSet. But I honestly think that this part of the code isn't even necessary:


function MCCFR_P(minutes = 1) {
  for (let p = 0; p < PLAYERS.length; p++) {
    Object.keys(treeMap).map(key => {
      const I = treeMap[key];
      if (getCurrentPlayerFromInfoSet(I.infoSet) === p) {
        const actions = getActionsFromInfoSet(I);
        let regretSum = [];
        let strategy = [];

        for (let a = 0; a < actions.length; a++) {
          regretSum[a] = 0;
          if (isPreflop(I)) {
            strategy[a] = 0; // 𝜙(Ii,a) = 0; not sure if this is correct
          }
        }
        treeMap[I.infoSet] = { ...I, regretSum, strategy };
      }
    });
  }

so that would make getActionsFromInfoSet uneccesary also