Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make the code compile #2

Open
MarekKosinski opened this issue Mar 22, 2020 · 7 comments
Open

make the code compile #2

MarekKosinski opened this issue Mar 22, 2020 · 7 comments

Comments

@MarekKosinski
Copy link

Hi,

I've downloaded your python port and I can't get it to compile - is it possible or it is not finished and the work must be done?

Thanks!

@whatsdis
Copy link
Owner

whatsdis commented Mar 23, 2020

getActionsFromInfoSet function is missing because it was not implemented in the original code. I asked @EAT-CODE-KITE-REPEAT but haven't heard back from him since. Also the deuces library has a different API so that needs to be fixed. So yes, work is very much needed in these areas. If anyone gets a working PR please let me know.

@MarekKosinski
Copy link
Author

I'm not asking for missing functionalities - I was wondering if this was by any chance compilable. I mean I've tried to compile it with Python 2.7, 3.6 and 3.8. Each time I had trillion syntax errors in the whole file. That's why I was wondering if this is something on my part or is this code simply not compilable yet?

@ghost
Copy link

ghost commented Mar 23, 2020

It works on nodejs in my repo
@whatsdis 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 whatsdis changed the title Is the port actually compilable make the code compile Mar 23, 2020
@whatsdis
Copy link
Owner

@EAT-CODE-KITE-REPEAT thanks for the response. I will implement that in #3

@MarekKosinski No it does not yet compile due to issues #3 and #4 I've described previously.

@MarekKosinski
Copy link
Author

Do you have any syntax errors? (other than deuces library and getActionsFromInfoSet function)

@theabhinavdas
Copy link

@MarekKosinski there are tons of syntax errors. The code uses // comments, for example. Rather look at the original stuff by @EAT-CODE-KITE-REPEAT or look at the poker_ai project.

@Mudr0x
Copy link

Mudr0x commented Jul 23, 2021

Please take a look from my commit:
Mudr0x@c61606a

I have corrected all code errors for Python 3.x (tested on Python 3.7) and now code is fully working.

However I don't really understand why you decide to translate Pluribus to Python the fact that NodeJS is very faster than Python (mostly for huge calculation) and I really certify this comparing NodeJS and Python code version speeds...
Maybe for the fact that NodeJS cannot working with multiple cores with a shared memory and Python can (especially with its multiprocessing.shared_memory library), can you confirm me this?... But maybe NodeJS limitation for shared memory can be overcome with some solutions I mentionned here: https://github.com/Karsens/pluribus-poker-bot-js/issues/2

What do you think folks?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants