A-Lounsbury / pysimultaneous

A class for handling simultaneous games with any number of players
0 stars 0 forks source link

Translate computeKStrategies function #14

Closed A-Lounsbury closed 3 months ago

A-Lounsbury commented 3 months ago

Translate the computeStrategies function from gt.

A-Lounsbury commented 3 months ago

For some reason, at line 1109, in this code segment:

else // x >= 2
                {                   
                    for (int m = 0; (unsigned)m < payoffMatrix.size(); m++)
                        for (int i = 0; i < players.at(0)->getNumStrats(); i++)
                        {
                            for (int j = 0; j < players.at(1)->getNumStrats(); j++)
                            {
                                if (payoffMatrix.at(m).at(others.at(0)).at(others.at(1))->getNodeBestResponse(1))
                                    maxStrat = unhash(m).at(x);
                            }
                        }

                }

we said if (payoffMatrix.at(m).at(others.at(0)).at(others.at(1))->getNodeBestResponse(1)) instead of if (payoffMatrix.at(m).at(others.at(0)).at(others.at(1))->getNodeBestResponse(x)). I'm almost certain it should be the latter.

A-Lounsbury commented 3 months ago

It's written and just needs to be tested.

A-Lounsbury commented 3 months ago

Tested. Didn't work. Had to computeBestResponses first. Need to test again and ensure outputs are correct.

A-Lounsbury commented 3 months ago

Outputs seem ok so far.