Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
29f656d
add 3 efg example games
edwardchalstrey1 Oct 20, 2025
287f593
modify one card poker ef to include chance labels
edwardchalstrey1 Oct 20, 2025
b28b167
nb tests cobversion
edwardchalstrey1 Oct 20, 2025
0d00d47
conversion imortable
edwardchalstrey1 Oct 20, 2025
2738b13
first attempt at converting efg to ef
edwardchalstrey1 Oct 20, 2025
46338d3
2nd attempt at conversion function
edwardchalstrey1 Oct 20, 2025
c8ca33c
refactor and rerun nb
edwardchalstrey1 Oct 20, 2025
cf6c8d4
good 2smp example
edwardchalstrey1 Oct 21, 2025
10306b0
fit to the 2smp game file
edwardchalstrey1 Oct 21, 2025
175b786
update 2smp example file
edwardchalstrey1 Oct 21, 2025
1df988b
generate Player names with explicit LaTeX escaping
edwardchalstrey1 Oct 21, 2025
9007022
fix tests and 2smp example looking good
edwardchalstrey1 Oct 21, 2025
4299b6f
2smp example looks good
edwardchalstrey1 Oct 21, 2025
d3d9968
one test
edwardchalstrey1 Oct 21, 2025
f985104
dont add player nodes when we add them to isset later
edwardchalstrey1 Oct 21, 2025
1eb75dc
fix for 2smp example
edwardchalstrey1 Oct 21, 2025
aa30672
reorder test
edwardchalstrey1 Oct 21, 2025
73eab84
refactor efg_to_ef function to remove file-specific overrides
edwardchalstrey1 Oct 21, 2025
f3da3b8
remove unused code
edwardchalstrey1 Oct 21, 2025
36e25b8
tidy comments
edwardchalstrey1 Oct 21, 2025
7cdc56d
add .ef files generated from .efg files to .gitignore
edwardchalstrey1 Oct 21, 2025
5f001b5
remove TinyTeX installation entry from .gitignore
edwardchalstrey1 Oct 21, 2025
2894811
add 2s2x2x2.ef game
edwardchalstrey1 Oct 21, 2025
b52f33a
fix d3
edwardchalstrey1 Oct 21, 2025
6777165
tidy this example ef
edwardchalstrey1 Oct 21, 2025
0c8f0ff
add 2s2x2x2.efg game
edwardchalstrey1 Oct 21, 2025
bbf71f0
update test with new example
edwardchalstrey1 Oct 21, 2025
93aa0b5
fit layout to 3rd example 2s2x2x2.efg
edwardchalstrey1 Oct 21, 2025
c4028f2
move import
edwardchalstrey1 Oct 21, 2025
083d8d4
add DefaultLayout class for .ef generation and corresponding tests
edwardchalstrey1 Oct 21, 2025
a103b29
add cent2 example with failing test
edwardchalstrey1 Oct 21, 2025
b417aa0
get spacing right on cent2 example
edwardchalstrey1 Oct 21, 2025
50d42b0
fix example to have extra chance nodes
edwardchalstrey1 Oct 21, 2025
91cf3a5
update cent2 example
edwardchalstrey1 Oct 21, 2025
c583f94
fix cent2
edwardchalstrey1 Oct 21, 2025
70762af
adjust IS levels in 2smp example
edwardchalstrey1 Oct 21, 2025
4727079
further
edwardchalstrey1 Oct 21, 2025
32a15f0
further
edwardchalstrey1 Oct 21, 2025
64cc939
finish leveling 2smp
edwardchalstrey1 Oct 21, 2025
7aa48b1
levels unimplemented
edwardchalstrey1 Oct 21, 2025
b9a9a2b
display chance nodes correctly
edwardchalstrey1 Oct 22, 2025
10887f0
first attempt at auto-levels
edwardchalstrey1 Oct 22, 2025
81a9a83
2smp example looking better
edwardchalstrey1 Oct 22, 2025
8eeeaf6
dont restrict non-infoset nodes from being on same level
edwardchalstrey1 Oct 22, 2025
d394c8f
keep non IS nodes at consistent levels
edwardchalstrey1 Oct 22, 2025
2932ffa
update cent2 example
edwardchalstrey1 Oct 22, 2025
5e173b2
better spacing on 2smp example
edwardchalstrey1 Oct 22, 2025
d2c7544
minimum spacing between connected nodes of 2 levels
edwardchalstrey1 Oct 22, 2025
e5f4193
standardise tree depth level
edwardchalstrey1 Oct 22, 2025
47153ed
update 2smp test
edwardchalstrey1 Oct 22, 2025
f98c94e
finish prev commit
edwardchalstrey1 Oct 22, 2025
1d36f9f
fix tests to current output
edwardchalstrey1 Oct 22, 2025
1dac7e1
finish prev commit
edwardchalstrey1 Oct 22, 2025
672d66a
update cent2 ef with decimals
edwardchalstrey1 Oct 22, 2025
cfab1a6
parse decimal payoffs correctly
edwardchalstrey1 Oct 22, 2025
9913dfe
minimum xshift of 0.73
edwardchalstrey1 Oct 22, 2025
da966a0
Revert "minimum xshift of 0.73"
edwardchalstrey1 Oct 22, 2025
f6d1691
crazy big examples that look bad
edwardchalstrey1 Oct 22, 2025
c82cbf4
generate from efg directly
edwardchalstrey1 Oct 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@ cython_debug/
*.toc
*.out

# TinyTeX installation
.pytinytex/

# Temporary files
tmp*
temp*
.tmp*
.temp*
.temp*

# .ef files generated from .efg files (the test suite)
games/efg/*.ef
36 changes: 36 additions & 0 deletions games/2s2x2x2.ef
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
player 1 name Player~1
player 2 name Player~2
player 3 name Player~3
level 0 node 1 player 1
level 2 node 1 xshift -3.58 from 0,1 move U1
level 2 node 2 xshift 3.58 from 0,1 move D1
level 6 node 1 xshift -1.9 from 2,2 move U2
level 6 node 2 xshift 1.9 from 2,2 move D2
level 8 node 1 xshift -0.90 from 6,2 move U3 payoffs 9 8 2
level 8 node 2 xshift 0.90 from 6,2 move D3 payoffs 0 0 0
level 8 node 3 xshift -0.90 from 6,1 move U3 payoffs 0 0 0
level 8 node 4 xshift 0.90 from 6,1 move D3 payoffs 3 4 6
level 6 node 3 xshift -1.9 from 2,1 move U2
level 6 node 4 xshift 1.9 from 2,1 move D2
level 8 node 5 xshift -0.90 from 6,4 move U3 payoffs 0 0 0
level 8 node 6 xshift 0.90 from 6,4 move D3 payoffs 3 4 6
level 10 node 1 player 1 xshift -1.65 from 6,3 move U3
level 8 node 7 xshift 0.90 from 6,3 move D3 payoffs 0 0 0
level 14 node 1 xshift -2.205 from 10,1 move U1
level 14 node 2 xshift 2.205 from 10,1 move D1
level 18 node 1 xshift -1.095 from 14,2 move U2
level 18 node 2 xshift 1.095 from 14,2 move D2
level 20 node 1 xshift -0.73 from 18,2 move U3 payoffs 9 8 2
level 20 node 2 xshift 0.73 from 18,2 move D3 payoffs 0 0 0
level 20 node 3 xshift -0.73 from 18,1 move U3 payoffs 0 0 0
level 20 node 4 xshift 0.73 from 18,1 move D3 payoffs 3 4 6
level 18 node 3 xshift -1.095 from 14,1 move U2
level 18 node 4 xshift 1.095 from 14,1 move D2
level 20 node 5 xshift -0.73 from 18,4 move U3 payoffs 0 0 0
level 20 node 6 xshift 0.73 from 18,4 move D3 payoffs 3 4 6
level 20 node 7 xshift -0.73 from 18,3 move U3 payoffs 9 8 12
level 20 node 8 xshift 0.73 from 18,3 move D3 payoffs 0 0 0
iset 2,2 2,1 player 2
iset 6,4 6,3 6,2 6,1 player 3
iset 14,2 14,1 player 2
iset 18,4 18,3 18,2 18,1 player 3
38 changes: 38 additions & 0 deletions games/2smp.ef
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
player 1 name Player~1
player 2 name Player~2
level 0 node 1 player 1
level 2 node 1 xshift -3.58 from 0,1 move H
level 2 node 2 xshift 3.58 from 0,1 move T
level 6 node 1 player 1 xshift -1.9 from 2,2 move H
level 6 node 2 player 1 xshift 1.9 from 2,2 move T
level 8 node 1 xshift -0.90 from 6,2 move H
level 8 node 2 xshift 0.90 from 6,2 move T
level 13 node 1 xshift -0.45 from 8,2 move H payoffs -1 1
level 13 node 2 xshift 0.45 from 8,2 move T payoffs 1 -1
level 13 node 3 xshift -0.45 from 8,1 move H payoffs 1 -1
level 13 node 4 xshift 0.45 from 8,1 move T payoffs -1 1
level 9 node 3 xshift -0.90 from 6,1 move H
level 9 node 4 xshift 0.90 from 6,1 move T
level 13 node 5 xshift -0.45 from 9,4 move H payoffs -1 1
level 13 node 6 xshift 0.45 from 9,4 move T payoffs 1 -1
level 13 node 7 xshift -0.45 from 9,3 move H payoffs 1 -1
level 13 node 8 xshift 0.45 from 9,3 move T payoffs -1 1
level 6 node 3 player 1 xshift -1.9 from 2,1 move H
level 6 node 4 player 1 xshift 1.9 from 2,1 move T
level 11 node 5 xshift -0.90 from 6,4 move H
level 11 node 6 xshift 0.90 from 6,4 move T
level 13 node 9 xshift -0.45 from 11,6 move H payoffs -1 1
level 13 node 10 xshift 0.45 from 11,6 move T payoffs 1 -1
level 13 node 11 xshift -0.45 from 11,5 move H payoffs 1 -1
level 13 node 12 xshift 0.45 from 11,5 move T payoffs -1 1
level 10 node 7 xshift -0.90 from 6,3 move H
level 10 node 8 xshift 0.90 from 6,3 move T
level 13 node 13 xshift -0.45 from 10,8 move H payoffs -1 1
level 13 node 14 xshift 0.45 from 10,8 move T payoffs 1 -1
level 13 node 15 xshift -0.45 from 10,7 move H payoffs 1 -1
level 13 node 16 xshift 0.45 from 10,7 move T payoffs -1 1
iset 2,2 2,1 player 2
iset 8,2 8,1 player 2
iset 9,4 9,3 player 2
iset 11,6 11,5 player 2
iset 10,8 10,7 player 2
41 changes: 41 additions & 0 deletions games/cent2.ef
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
player 1 name Player~1
player 2 name Player~2
level 0 node 1 player 0
level 2 node 1 player 0 xshift -7.16 from 0,1 move 1=rational~(1)
level 2 node 2 player 0 xshift 7.16 from 0,1 move 1=altruist~(\frac{19}{20})
level 7 node 1 xshift -0.62 from 2,2 move 2=rational~(2)
level 7 node 2 xshift 0.62 from 2,2 move 2=altruist~(\frac{19}{20})
level 11 node 1 xshift -0.90 from 7,2 move p
level 15 node 1 xshift 0.00 from 11,1 move p
level 19 node 1 xshift 0.00 from 15,1 move p
level 21 node 1 xshift 0.00 from 19,1 move p payoffs 12.80 3.20
level 10 node 2 xshift -0.90 from 7,1 move p
level 12 node 1 xshift -0.45 from 10,2 move t payoffs 0.40 1.60
level 15 node 2 xshift 0.41 from 10,2 move p
level 18 node 2 xshift -1.095 from 15,2 move p
level 21 node 2 xshift -0.55 from 18,2 move t payoffs 1.60 6.40
level 21 node 3 xshift 0.55 from 18,2 move p payoffs 12.80 3.20
level 6 node 3 xshift -4.18 from 2,1 move 2=rational~(2)
level 6 node 4 xshift 4.18 from 2,1 move 2=altruist~(\frac{19}{20})
level 8 node 1 xshift -0.90 from 6,4 move t payoffs 0.80 0.20
level 11 node 3 xshift 0.90 from 6,4 move p
level 14 node 3 xshift -2.205 from 11,3 move p
level 16 node 1 xshift -0.55 from 14,3 move t payoffs 3.20 0.80
level 19 node 3 xshift 0.27 from 14,3 move p
level 21 node 4 xshift 0.00 from 19,3 move p payoffs 12.80 3.20
level 8 node 2 xshift -0.90 from 6,3 move t payoffs 0.80 0.20
level 10 node 4 xshift 0.90 from 6,3 move p
level 12 node 2 xshift -0.45 from 10,4 move t payoffs 0.40 1.60
level 14 node 4 xshift 2.205 from 10,4 move p
level 16 node 2 xshift -0.82 from 14,4 move t payoffs 3.20 0.80
level 18 node 4 xshift 1.095 from 14,4 move p
level 21 node 5 xshift -0.55 from 18,4 move t payoffs 1.60 6.40
level 21 node 6 xshift 0.55 from 18,4 move p payoffs 12.80 3.20
iset 7,2 7,1 player 1
iset 11,3 11,1 player 2
iset 15,2 15,1 player 1
iset 19,3 19,1 player 2
iset 10,4 10,2 player 2
iset 18,4 18,2 player 2
iset 6,4 6,3 player 1
iset 14,4 14,3 player 1
32 changes: 32 additions & 0 deletions games/efg/2s2x2x2.efg
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
EFG 2 R "Two stage McKelvey McLennan game with 9 equilibria each stage" { "Player 1" "Player 2" "Player 3" }
""

p "" 1 1 "Infoset2" { "U1" "D1" } 0
p "" 2 1 ":1" { "U2" "D2" } 0
p "" 3 1 ":1" { "U3" "D3" } 0
p "" 1 2 "" { "U1" "D1" } 1 "Outcome 2" { 9, 8, 12 }
p "" 2 2 "Infoset3" { "U2" "D2" } 0
p "" 3 2 "Infoset3" { "U3" "D3" } 0
t "" 1 "Outcome 2" { 9, 8, 12 }
t "" 2 "Outcome 1" { 0, 0, 0 }
p "" 3 2 "Infoset3" { "U3" "D3" } 0
t "" 2 "Outcome 1" { 0, 0, 0 }
t "" 3 "Outcome 4" { 3, 4, 6 }
p "" 2 2 "Infoset3" { "U2" "D2" } 0
p "" 3 2 "Infoset3" { "U3" "D3" } 0
t "" 2 "Outcome 1" { 0, 0, 0 }
t "" 3 "Outcome 4" { 3, 4, 6 }
p "" 3 2 "Infoset3" { "U3" "D3" } 0
t "" 4 "Outcome 3" { 9, 8, 2 }
t "" 2 "Outcome 1" { 0, 0, 0 }
t "" 2 "Outcome 1" { 0, 0, 0 }
p "" 3 1 ":1" { "U3" "D3" } 0
t "" 2 "Outcome 1" { 0, 0, 0 }
t "" 3 "Outcome 4" { 3, 4, 6 }
p "" 2 1 ":1" { "U2" "D2" } 0
p "" 3 1 ":1" { "U3" "D3" } 0
t "" 2 "Outcome 1" { 0, 0, 0 }
t "" 3 "Outcome 4" { 3, 4, 6 }
p "" 3 1 ":1" { "U3" "D3" } 0
t "" 4 "Outcome 3" { 9, 8, 2 }
t "" 2 "Outcome 1" { 0, 0, 0 }
34 changes: 34 additions & 0 deletions games/efg/2smp.efg
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
EFG 2 R "Two-stage matching pennies game" { "Player 1" "Player 2" }
""

p "" 1 1 "" { "H" "T" } 0
p "" 2 1 "" { "H" "T" } 0
p "" 1 2 "" { "H" "T" } 1 "Match" { 1, -1 }
p "" 2 2 "" { "H" "T" } 0
t "" 1 "Match" { 1, -1 }
t "" 2 "Mismatch" { -1, 1 }
p "" 2 2 "" { "H" "T" } 0
t "" 2 "Mismatch" { -1, 1 }
t "" 1 "Match" { 1, -1 }
p "" 1 3 "" { "H" "T" } 2 "Mismatch" { -1, 1 }
p "" 2 3 "" { "H" "T" } 0
t "" 1 "Match" { 1, -1 }
t "" 2 "Mismatch" { -1, 1 }
p "" 2 3 "" { "H" "T" } 0
t "" 2 "Mismatch" { -1, 1 }
t "" 1 "Match" { 1, -1 }
p "" 2 1 "" { "H" "T" } 0
p "" 1 4 "" { "H" "T" } 2 "Mismatch" { -1, 1 }
p "" 2 4 "" { "H" "T" } 0
t "" 1 "Match" { 1, -1 }
t "" 2 "Mismatch" { -1, 1 }
p "" 2 4 "" { "H" "T" } 0
t "" 2 "Mismatch" { -1, 1 }
t "" 1 "Match" { 1, -1 }
p "" 1 5 "" { "H" "T" } 1 "Match" { 1, -1 }
p "" 2 5 "" { "H" "T" } 0
t "" 1 "Match" { 1, -1 }
t "" 2 "Mismatch" { -1, 1 }
p "" 2 5 "" { "H" "T" } 0
t "" 2 "Mismatch" { -1, 1 }
t "" 1 "Match" { 1, -1 }
34 changes: 34 additions & 0 deletions games/efg/cent2.efg
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
EFG 2 R "Centipede game. Two inning, with probability of altruists. " { "Player 1" "Player 2" }
""

c "" 1 "(0,1)" { "1=rational" 19/20 "1=altruist" 1/20 } 0
c "" 2 "(0,2)" { "2=rational" 19/20 "2=altruist" 1/20 } 0
p "" 1 1 "(1,1)" { "t" "p" } 0
t "" 1 "Outcome 1" { .80, .20 }
p "" 2 1 "(2,1)" { "t" "p" } 0
t "" 2 "Outcome 2" { .40, 1.60 }
p "" 1 2 "(1,2)" { "t" "p" } 0
t "" 3 "Outcome 3" { 3.20, .80 }
p "" 2 2 "(2,2)" { "t" "p" } 0
t "" 4 "Outcome 4" { 1.60, 6.40 }
t "" 5 "Outcome 5" { 12.80, 3.20 }
p "" 1 1 "(1,1)" { "t" "p" } 0
t "" 6 "Outcome 11" { .80, .20 }
p "" 2 3 "(2,3)" { "p" } 0
p "" 1 2 "(1,2)" { "t" "p" } 0
t "" 7 "Outcome 13" { 3.20, .80 }
p "" 2 4 "(2,4)" { "p" } 0
t "" 5 "Outcome 5" { 12.80, 3.20 }
c "" 3 "(0,3)" { "2=rational" 19/20 "2=altruist" 1/20 } 0
p "" 1 3 "(1,3)" { "p" } 0
p "" 2 1 "(2,1)" { "t" "p" } 0
t "" 8 "Outcome 22" { .40, 1.60 }
p "" 1 4 "(1,4)" { "p" } 0
p "" 2 2 "(2,2)" { "t" "p" } 0
t "" 9 "Outcome 24" { 1.60, 6.40 }
t "" 5 "Outcome 5" { 12.80, 3.20 }
p "" 1 3 "(1,3)" { "p" } 0
p "" 2 3 "(2,3)" { "p" } 0
p "" 1 4 "(1,4)" { "p" } 0
p "" 2 4 "(2,4)" { "p" } 0
t "" 5 "Outcome 5" { 12.80, 3.20 }
22 changes: 22 additions & 0 deletions games/efg/cross.efg
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
EFG 2 R "Criss-crossing infosets" { "Player 1" "Player 2" }
""

p "ROOT" 1 1 "" { "1" "2" } 0
p "" 2 1 "" { "1" "2" } 0
p "" 1 2 "" { "1" "2" } 0
p "" 2 2 "" { "1" "2" } 0
t "" 0
t "" 0
t "" 0
p "" 1 2 "" { "1" "2" } 0
t "" 0
t "" 0
p "" 2 2 "" { "1" "2" } 0
p "" 1 3 "" { "1" "2" } 0
p "" 2 1 "" { "1" "2" } 0
t "" 0
t "" 0
t "" 0
p "" 1 3 "" { "1" "2" } 0
t "" 0
t "" 0
Loading