graph-games-proto 0.3.1897__py3-none-any.whl → 0.3.1899__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 CHANGED
@@ -4078,8 +4078,21 @@ class StateKernal(PClass):
4078
4078
  history = field(type=list) # List[PublicAction]
4079
4079
  player_scores = field(type=list) # List[PlayerScore]
4080
4080
  game_config = field(type=GameConfig)
4081
+ uuid2edge = field(type=dict) # Dict[str, BiEdge]
4082
+ idx2path = field(type=list) # List[Path2]
4083
+ uuid2segment = field(type=dict) # Dict[str, Segment]
4084
+
4081
4085
 
4082
4086
  def init_state_kernal(**kwargs):
4087
+ uuid2edge = {}
4088
+ idx2path = []
4089
+ uuid2segment = {}
4090
+ for edge in kwargs.get('edges'):
4091
+ uuid2edge[edge.uuid] = edge
4092
+ for path in edge.paths:
4093
+ idx2path.append(path)
4094
+ for segment in path.segments:
4095
+ uuid2segment[segment.uuid] = segment
4083
4096
  return StateKernal(
4084
4097
  edges=kwargs.get('edges'),
4085
4098
  decks=kwargs.get('decks'),
@@ -4089,10 +4102,12 @@ def init_state_kernal(**kwargs):
4089
4102
  history=kwargs.get('history'),
4090
4103
  player_scores=kwargs.get('player_scores'),
4091
4104
  game_config=kwargs.get('game_config'),
4105
+ uuid2edge=uuid2edge,
4106
+ idx2path=idx2path,
4107
+ uuid2segment=uuid2segment,
4092
4108
  )
4093
4109
 
4094
4110
 
4095
-
4096
4111
  def getnextstate2(s, a, log=False):
4097
4112
  is_legal, reason = isactionlegal2(s, a)
4098
4113
  if not is_legal:
@@ -5499,8 +5514,7 @@ def get_default_legal_actions(state_kernal, player_idx):
5499
5514
  )
5500
5515
 
5501
5516
  if len(state_kernal.decks[0].facedown_stack) >= 2:
5502
- state_kernal = append_to_legal_actions(
5503
- state_kernal,
5517
+ legal_actions.append(
5504
5518
  LegalAction(
5505
5519
  player_idx=player_idx,
5506
5520
  name="DRAW-DOUBLE",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: graph_games_proto
3
- Version: 0.3.1897
3
+ Version: 0.3.1899
4
4
  Requires-Dist: multipledispatch==1.0.0
5
5
  Requires-Dist: pyrsistent==0.20.0
6
6
  Requires-Dist: numpy==2.2.4
@@ -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=Aqcoiw2rungLAiTgtj4Su_BpliNWO__s70knUaWkcIE,187324
3
+ graph_games_proto/fns.py,sha256=KTIphQZY1BFWH22Ujqu4MdBjHY1d16JLt0Exf9lH-uU,187823
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.1897.dist-info/METADATA,sha256=wPb_gd1bIy9puPul8HzXMOixr0wqyY0XIF_dV2dfePE,188
7
- graph_games_proto-0.3.1897.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
8
- graph_games_proto-0.3.1897.dist-info/top_level.txt,sha256=-4QSrBMf_MM4BGsr2QXBpqDx8c8k_OPnzGyFjqjakes,18
9
- graph_games_proto-0.3.1897.dist-info/RECORD,,
6
+ graph_games_proto-0.3.1899.dist-info/METADATA,sha256=jLL2r4ROFRYQwBWIy1FCaLuRyYUuAPewICilDfng0lw,188
7
+ graph_games_proto-0.3.1899.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
8
+ graph_games_proto-0.3.1899.dist-info/top_level.txt,sha256=-4QSrBMf_MM4BGsr2QXBpqDx8c8k_OPnzGyFjqjakes,18
9
+ graph_games_proto-0.3.1899.dist-info/RECORD,,