A-Lounsbury / pysimultaneous

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

Compute kOutcomes before computing kOutcomeProbabilities #20

Closed A-Lounsbury closed 3 months ago

A-Lounsbury commented 3 months ago

line 1079

def computeOutcomeProbabilities(self):
        self.computeKStrategies()
        for r1 in range(4):
            for r2 in range(4):
                probability = 0.0

                # find which outcome the kMatrix entry corresponds to
                index = 0
                # FIXME: self.kOutcomes has length 0! 
                while self.kOutcomes[index][0] != self.kStrategies[r1][0] or self.kOutcomes[index][1] != self.kStrategies[r2][1]:
                    index += 1

                probability += probabilities[r1] * probabilities[r2]

                self.outcomeProbabilities[index] = self.outcomeProbabilities[index] + probability
A-Lounsbury commented 3 months ago

I believe we've done this, since we just got the printKMatrix function working.