graph-games-proto 0.3.1898__py3-none-any.whl → 0.3.1900__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,10 +4078,26 @@ 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
+ edgeuuid2idx = field(type=dict) # Dict[str, int]
4085
+
4081
4086
 
4082
4087
  def init_state_kernal(**kwargs):
4088
+ edges = kwargs.get('edges', [])
4089
+ uuid2edge = {}
4090
+ idx2path = []
4091
+ uuid2segment = {}
4092
+ edgeuuid2idx = {edge.uuid: idx for idx, edge in enumerate(edges)}
4093
+ for edge in edges:
4094
+ uuid2edge[edge.uuid] = edge
4095
+ for path in edge.paths:
4096
+ idx2path.append(path)
4097
+ for segment in path.segments:
4098
+ uuid2segment[segment.uuid] = segment
4083
4099
  return StateKernal(
4084
- edges=kwargs.get('edges'),
4100
+ edges=edges,
4085
4101
  decks=kwargs.get('decks'),
4086
4102
  piles=kwargs.get('piles'),
4087
4103
  players=kwargs.get('players'),
@@ -4089,10 +4105,13 @@ def init_state_kernal(**kwargs):
4089
4105
  history=kwargs.get('history'),
4090
4106
  player_scores=kwargs.get('player_scores'),
4091
4107
  game_config=kwargs.get('game_config'),
4108
+ uuid2edge=uuid2edge,
4109
+ idx2path=idx2path,
4110
+ uuid2segment=uuid2segment,
4111
+ edgeuuid2idx=edgeuuid2idx,
4092
4112
  )
4093
4113
 
4094
4114
 
4095
-
4096
4115
  def getnextstate2(s, a, log=False):
4097
4116
  is_legal, reason = isactionlegal2(s, a)
4098
4117
  if not is_legal:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: graph_games_proto
3
- Version: 0.3.1898
3
+ Version: 0.3.1900
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=DJTM-VwAx-5vcXtBLGgdczV80jCGkP3_Jake_GMMw0U,187280
3
+ graph_games_proto/fns.py,sha256=UaOPciy5NGI80NFPQ7UkCAh76MTngEOQfwdd9v-Zgs4,187990
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.1898.dist-info/METADATA,sha256=j3adFTTmlHyIBV75pT5bO9GEEEN3LPvNQhgVIfPf57I,188
7
- graph_games_proto-0.3.1898.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
8
- graph_games_proto-0.3.1898.dist-info/top_level.txt,sha256=-4QSrBMf_MM4BGsr2QXBpqDx8c8k_OPnzGyFjqjakes,18
9
- graph_games_proto-0.3.1898.dist-info/RECORD,,
6
+ graph_games_proto-0.3.1900.dist-info/METADATA,sha256=AHrt9_-p3mdMs6pDQ0nrl_Vzly7iMgnU7IeqofXelbk,188
7
+ graph_games_proto-0.3.1900.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
8
+ graph_games_proto-0.3.1900.dist-info/top_level.txt,sha256=-4QSrBMf_MM4BGsr2QXBpqDx8c8k_OPnzGyFjqjakes,18
9
+ graph_games_proto-0.3.1900.dist-info/RECORD,,