pluribus icon indicating copy to clipboard operation
pluribus copied to clipboard

implement getActionsFromInfoSet

Open whatsdis opened this issue 4 years ago • 0 comments

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

whatsdis avatar Mar 23 '20 23:03 whatsdis