graph-games-proto 0.3.1964__py3-none-any.whl → 0.3.1966__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- graph_games_proto/fns.py +16 -16
- {graph_games_proto-0.3.1964.dist-info → graph_games_proto-0.3.1966.dist-info}/METADATA +1 -1
- {graph_games_proto-0.3.1964.dist-info → graph_games_proto-0.3.1966.dist-info}/RECORD +5 -5
- {graph_games_proto-0.3.1964.dist-info → graph_games_proto-0.3.1966.dist-info}/WHEEL +0 -0
- {graph_games_proto-0.3.1964.dist-info → graph_games_proto-0.3.1966.dist-info}/top_level.txt +0 -0
graph_games_proto/fns.py
CHANGED
@@ -2564,7 +2564,7 @@ def getsettingvalue(f, setting_name):
|
|
2564
2564
|
|
2565
2565
|
@dispatch(State, str)
|
2566
2566
|
def getsettingvalue(s, setting_name):
|
2567
|
-
return getsettingvalue(s.game_config.fig, setting_name)
|
2567
|
+
return getsettingvalue(s.kernel.game_config.fig, setting_name)
|
2568
2568
|
|
2569
2569
|
|
2570
2570
|
@dispatch(GameConfig)
|
@@ -4136,7 +4136,7 @@ def getpublictoplay(s):
|
|
4136
4136
|
def get_max_allotted_times(s):
|
4137
4137
|
return [
|
4138
4138
|
get_player_max_allotted_time(s, player_idx)
|
4139
|
-
for player_idx in range(s.game_config.num_players)
|
4139
|
+
for player_idx in range(s.kernel.game_config.num_players)
|
4140
4140
|
]
|
4141
4141
|
|
4142
4142
|
|
@@ -4162,7 +4162,7 @@ def get_deadline(s, max_allotted_time):
|
|
4162
4162
|
since_action_idx = max_allotted_time.since_action_idx
|
4163
4163
|
if since_action_idx == -1:
|
4164
4164
|
allotted_since = datetime.strptime(
|
4165
|
-
s.game_config.started_at,
|
4165
|
+
s.kernel.game_config.started_at,
|
4166
4166
|
"%Y-%m-%d %H:%M:%S"
|
4167
4167
|
)
|
4168
4168
|
else:
|
@@ -4180,7 +4180,7 @@ def get_deadline(s, max_allotted_time):
|
|
4180
4180
|
|
4181
4181
|
def get_deadlines(s):
|
4182
4182
|
if isterminal(s):
|
4183
|
-
return [None for _ in range(s.game_config.num_players)]
|
4183
|
+
return [None for _ in range(s.kernel.game_config.num_players)]
|
4184
4184
|
return [
|
4185
4185
|
get_deadline(s, max_alloted_time)
|
4186
4186
|
for max_alloted_time in get_max_allotted_times(s)
|
@@ -4264,7 +4264,7 @@ def isterminal(s):
|
|
4264
4264
|
def getpublicstate(s):
|
4265
4265
|
return PublicState(
|
4266
4266
|
deadlines=get_deadlines(s),
|
4267
|
-
game_started_at=s.game_config.started_at,
|
4267
|
+
game_started_at=s.kernel.game_config.started_at,
|
4268
4268
|
allotted_times=get_max_allotted_times(s),
|
4269
4269
|
all_pieces=list(s.pieceuuid2piece.values()),
|
4270
4270
|
to_play_2=getpublictoplay(s),
|
@@ -4302,10 +4302,10 @@ def getpublicdeck(s, d):
|
|
4302
4302
|
|
4303
4303
|
@dispatch(State, Player)
|
4304
4304
|
def getpublicplayer(s, p):
|
4305
|
-
deck_counts = [0 for _ in s.game_config.fig.board_config.deks]
|
4305
|
+
deck_counts = [0 for _ in s.kernel.game_config.fig.board_config.deks]
|
4306
4306
|
for card in p.cards:
|
4307
4307
|
deck_counts[s.kernel.carduuid2card[card].deck_idx] += 1
|
4308
|
-
piece_template_counts = [0 for _ in s.game_config.fig.board_config.piece_templates]
|
4308
|
+
piece_template_counts = [0 for _ in s.kernel.game_config.fig.board_config.piece_templates]
|
4309
4309
|
for piece_uuid in p.pieces:
|
4310
4310
|
piece_template_counts[s.pieceuuid2piece[piece_uuid].piece_template_idx] += 1
|
4311
4311
|
return PublicPlayer(
|
@@ -4349,10 +4349,10 @@ def getpublicscore(s, player_idx):
|
|
4349
4349
|
path_lens = getplayerpathlens(s, player_idx)
|
4350
4350
|
if not path_lens:
|
4351
4351
|
return 0
|
4352
|
-
addends.append(sum(s.game_config.fig.path_scores[len] for len in path_lens))
|
4352
|
+
addends.append(sum(s.kernel.game_config.fig.path_scores[len] for len in path_lens))
|
4353
4353
|
|
4354
4354
|
if getsettingvalue(s, 'cluster_scoring'):
|
4355
|
-
clusters = s.game_config.fig.board_config.clusters
|
4355
|
+
clusters = s.kernel.game_config.fig.board_config.clusters
|
4356
4356
|
uuid2cluster = {x.uuid: x for x in clusters}
|
4357
4357
|
completed_clusters = s.player_hands[player_idx].completed_clusters
|
4358
4358
|
cluster_scores = [uuid2cluster[cluster_uuid].score for cluster_uuid in completed_clusters]
|
@@ -4375,7 +4375,7 @@ def getplayerpathlens(s, player_idx):
|
|
4375
4375
|
# Implementing the following Julia function:
|
4376
4376
|
# getpathlens(s::State) = length.(getfield.(getfield.(s.fig.board_config.board_paths, :path), :segments))
|
4377
4377
|
def getpathlens(s):
|
4378
|
-
return [len(p.path.segments) for p in s.game_config.fig.board_config.board_paths]
|
4378
|
+
return [len(p.path.segments) for p in s.kernel.game_config.fig.board_config.board_paths]
|
4379
4379
|
|
4380
4380
|
# Implementing the following Julia function:
|
4381
4381
|
# function getplayerpathidxs(s::State, player_idx::Int)
|
@@ -4415,7 +4415,7 @@ def getactiontype(action_name):
|
|
4415
4415
|
|
4416
4416
|
|
4417
4417
|
# Function implements the following Julia function:
|
4418
|
-
# getlastplayeridxplus1(s) = mod1(getlastaction(s).player_idx + 1, s.game_config.num_players)
|
4418
|
+
# getlastplayeridxplus1(s) = mod1(getlastaction(s).player_idx + 1, s.kernel.game_config.num_players)
|
4419
4419
|
def getlastplayeridxplus1(s):
|
4420
4420
|
pass
|
4421
4421
|
|
@@ -4561,7 +4561,7 @@ def combinations(a, n=None):
|
|
4561
4561
|
def getpotentialpathidxs(s, player_num):
|
4562
4562
|
num_pieces = s.player_hands[player_num-1].num_pieces
|
4563
4563
|
return list(
|
4564
|
-
set(getpathidxs(s.game_config.fig, num_pieces)) - set(getunavailablepathidxs(s, player_num))
|
4564
|
+
set(getpathidxs(s.kernel.game_config.fig, num_pieces)) - set(getunavailablepathidxs(s, player_num))
|
4565
4565
|
)
|
4566
4566
|
# return list(set(getpathidxs(s.fig, num_pieces)) - set(getunavailablepaths(s, player_num)))
|
4567
4567
|
|
@@ -4625,16 +4625,16 @@ def getunavailablepathidxs(s, player_idx):
|
|
4625
4625
|
link2paths = {}
|
4626
4626
|
path2link = {}
|
4627
4627
|
|
4628
|
-
for board_path in s.game_config.fig.board_config.board_paths:
|
4628
|
+
for board_path in s.kernel.game_config.fig.board_config.board_paths:
|
4629
4629
|
link_idx = board_path.link_num - 1
|
4630
4630
|
if link_idx not in link2paths:
|
4631
4631
|
link2paths[link_idx] = []
|
4632
4632
|
link2paths[link_idx].append(board_path.num-1)
|
4633
4633
|
path2link[board_path.num-1] = link_idx
|
4634
4634
|
|
4635
|
-
multipath_links = [(board_link.num-1) for board_link in getmultipathlinks(s.game_config.fig)]
|
4635
|
+
multipath_links = [(board_link.num-1) for board_link in getmultipathlinks(s.kernel.game_config.fig)]
|
4636
4636
|
|
4637
|
-
if s.game_config.num_players < 4:
|
4637
|
+
if s.kernel.game_config.num_players < 4:
|
4638
4638
|
blocking_hands = s.player_hands
|
4639
4639
|
else:
|
4640
4640
|
blocking_hands = [s.player_hands[player_idx]]
|
@@ -5140,7 +5140,7 @@ def getqproxy0(ps, a, td):
|
|
5140
5140
|
return rewards
|
5141
5141
|
v_proxies = [
|
5142
5142
|
getvproxy0(getprivatestate(next_s, i))
|
5143
|
-
for i in range(next_s.game_config.num_players)
|
5143
|
+
for i in range(next_s.kernel.game_config.num_players)
|
5144
5144
|
]
|
5145
5145
|
q_proxies = [
|
5146
5146
|
r + v_proxies[i]
|
@@ -1,9 +1,9 @@
|
|
1
1
|
graph_games_proto/__init__.py,sha256=_EVQR-51XehfH45XZlba1WPdx3omS3Gm1nTwrgGyn2Q,667
|
2
2
|
graph_games_proto/all_types.py,sha256=IpbwftEcHS5Ewz-saFNk0lO9FvcbuHG36odRTayCXUk,54911
|
3
|
-
graph_games_proto/fns.py,sha256=
|
3
|
+
graph_games_proto/fns.py,sha256=XaDJPmMLioflSj00zzPXjdF1JfBh-hZB5dLO1OTn7lQ,182090
|
4
4
|
graph_games_proto/main.py,sha256=fj2U7KcwrpZtuUhjOX5yVxY18LZvvsxDFYZ_S5mxe04,145
|
5
5
|
graph_games_proto/state.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
-
graph_games_proto-0.3.
|
7
|
-
graph_games_proto-0.3.
|
8
|
-
graph_games_proto-0.3.
|
9
|
-
graph_games_proto-0.3.
|
6
|
+
graph_games_proto-0.3.1966.dist-info/METADATA,sha256=4JWfsAdg8cjBPgPN1tFc6UuRWIMKSvKtceQmO5iRN4s,188
|
7
|
+
graph_games_proto-0.3.1966.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
8
|
+
graph_games_proto-0.3.1966.dist-info/top_level.txt,sha256=-4QSrBMf_MM4BGsr2QXBpqDx8c8k_OPnzGyFjqjakes,18
|
9
|
+
graph_games_proto-0.3.1966.dist-info/RECORD,,
|
File without changes
|
File without changes
|