Closed A-Lounsbury closed 3 months ago
Fixed when appending a strategy for players 1 and 2 for games up to 3 players.
Need to check for the correct numbers of outcomes. The following test results in an IndexError:
o1 = ListNode()
o2 = ListNode()
o1 = o1.load([10, 10])
o2 = o2.load([20, 20])
append_2 = [
[o1, o2, o2]
]
G = SimGame(2)
G.appendStrategy(1, append_2)
G.print()
Fixed for players 1 and 2.
For some reason, this test
o1 = ListNode()
o2 = ListNode()
o3 = ListNode()
o4 = ListNode()
o5 = ListNode()
o6 = ListNode()
o7 = ListNode()
o8 = ListNode()
o9 = ListNode()
o1 = o1.load([1, 1, 1])
o2 = o2.load([2, 2, 2])
o3 = o3.load([3, 3, 3])
o4 = o4.load([4, 4, 4])
o5 = o5.load([5, 5, 5])
o6 = o6.load([6, 6, 6])
o7 = o7.load([7, 7, 7])
o8 = o8.load([8, 8, 8])
o9 = o9.load([9, 9, 9])
append_3_player3 = [
[
[o1, o2, o3],
[o4, o5, o6],
[o7, o8, o9]
]
]
H = SimGame(3)
H.appendStrategy(2, append_3_player3)
H.print()
results in
0, 0, 0 0, 0, 0
0, 0, 0 0, 0, 0
0, 0, 0 0, 0, 0
0, 0, 0 0, 0, 0
1, 1, 1 2, 2, 2
4, 4, 4 5, 5, 5
The appendStrategy function should accept lists who's submembers are either lists of floats/ints or LIstNodes (linked lists).
The previous comment has been dealt with.
The issue of it appending part of an array that's the wrong size has been resolved.
This code:
results in this payoff matrix: