forked from LaraRos/mkbsc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
45 lines (35 loc) · 1.16 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env python3
from mkbsc import MultiplayerGame, iterate_until_isomorphic, \
export, to_string, from_string, to_file, from_file
#states
L = ["start", "hole", "no hole", "win", "lose"]
#initial state
L0 = "start"
#action alphabet
Sigma = (("G", "P", "D"), ("G", "P", "D"))
#action labeled transitions
Delta = [
("start", ("G", "G"), "hole"),
("start", ("G", "G"), "no hole"),
("hole", ("D", "D"), "hole"),
("hole", ("P", "P"), "win"),
("hole", ("P", "D"), "lose"),
("hole", ("D", "P"), "lose"),
("no hole", ("D", "D"), "hole"),
("no hole", ("D", "P"), "lose"),
("no hole", ("P", "D"), "lose"),
("hole", ("P", "P"), "lose"),
]
#observation partitioning
Obs = [
[["start"], ["hole", "no hole"], ["win"], ["lose"]],
[["start"], ["hole"], ["no hole"], ["win"], ["lose"]]
]
#G is a Multiplayer Game-object, and so are GK and GK0
G = MultiplayerGame.create(L, L0, Sigma, Delta, Obs)
GK = G.KBSC()
G2K = GK.KBSC()
# We set epistemic to e-tree to generate e-trees as a representation of the knowledge in the game graph
export(G2K, "G2K", epistemic = "e-tree", file = "eps")
#print(test)
#to_file(GK, "GK")