algorhino-anemone 0.1.3__tar.gz → 0.1.5__tar.gz

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.
Files changed (89) hide show
  1. {algorhino_anemone-0.1.3/src/algorhino_anemone.egg-info → algorhino_anemone-0.1.5}/PKG-INFO +2 -2
  2. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/pyproject.toml +4 -4
  3. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5/src/algorhino_anemone.egg-info}/PKG-INFO +2 -2
  4. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/algorhino_anemone.egg-info/requires.txt +1 -1
  5. algorhino_anemone-0.1.5/src/anemone/basics.py +6 -0
  6. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/factory.py +4 -3
  7. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/node_evaluation/node_direct_evaluation/node_direct_evaluator.py +1 -1
  8. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/node_evaluation/node_tree_evaluation/node_minmax_evaluation.py +2 -1
  9. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/node_evaluation/node_tree_evaluation/node_tree_evaluation.py +1 -1
  10. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/node_factory/algorithm_node_factory.py +5 -2
  11. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/nodes/algorithm_node/algorithm_node.py +8 -5
  12. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/tree_and_value_branch_selector.py +1 -1
  13. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/tree_manager/tree_manager.py +2 -2
  14. algorhino_anemone-0.1.3/src/anemone/basics.py +0 -23
  15. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/LICENSE +0 -0
  16. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/README.md +0 -0
  17. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/setup.cfg +0 -0
  18. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/algorhino_anemone.egg-info/SOURCES.txt +0 -0
  19. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/algorhino_anemone.egg-info/dependency_links.txt +0 -0
  20. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/algorhino_anemone.egg-info/top_level.txt +0 -0
  21. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/__init__.py +0 -0
  22. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/indices/__init__.py +0 -0
  23. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/indices/index_manager/__init__.py +0 -0
  24. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/indices/index_manager/factory.py +0 -0
  25. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/indices/index_manager/node_exploration_manager.py +0 -0
  26. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/indices/node_indices/__init__.py +0 -0
  27. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/indices/node_indices/factory.py +0 -0
  28. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/indices/node_indices/index_data.py +0 -0
  29. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/indices/node_indices/index_types.py +0 -0
  30. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/nn/torch_evaluator.py +0 -0
  31. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/node_evaluation/__init__.py +0 -0
  32. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/node_evaluation/node_direct_evaluation/__init__.py +0 -0
  33. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/node_evaluation/node_direct_evaluation/factory.py +0 -0
  34. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/node_evaluation/node_tree_evaluation/node_tree_evaluation_factory.py +0 -0
  35. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/node_factory/__init__.py +0 -0
  36. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/node_factory/base.py +0 -0
  37. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/node_selector/__init__.py +0 -0
  38. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/node_selector/branch_explorer.py +0 -0
  39. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/node_selector/factory.py +0 -0
  40. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/node_selector/node_selector.py +0 -0
  41. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/node_selector/node_selector_args.py +0 -0
  42. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/node_selector/node_selector_types.py +0 -0
  43. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/node_selector/notations_and_statics.py +0 -0
  44. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/node_selector/opening_instructions.py +0 -0
  45. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/node_selector/recurzipf/__init__.py +0 -0
  46. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/node_selector/recurzipf/recur_zipf_base.py +0 -0
  47. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/node_selector/sequool/__init__.py +0 -0
  48. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/node_selector/sequool/factory.py +0 -0
  49. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/node_selector/sequool/sequool.py +0 -0
  50. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/node_selector/uniform/__init__.py +0 -0
  51. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/node_selector/uniform/uniform.py +0 -0
  52. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/nodes/__init__.py +0 -0
  53. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/nodes/algorithm_node/__init__.py +0 -0
  54. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/nodes/itree_node.py +0 -0
  55. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/nodes/tree_node.py +0 -0
  56. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/nodes/tree_traversal.py +0 -0
  57. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/nodes/utils.py +0 -0
  58. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/progress_monitor/__init__.py +0 -0
  59. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/progress_monitor/progress_monitor.py +0 -0
  60. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/recommender_rule/__init__.py +0 -0
  61. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/recommender_rule/recommender_rule.py +0 -0
  62. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/search_factory/__init__.py +0 -0
  63. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/search_factory/search_factory.py +0 -0
  64. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/state_transition.py +0 -0
  65. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/tree_exploration.py +0 -0
  66. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/tree_manager/__init__.py +0 -0
  67. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/tree_manager/algorithm_node_tree_manager.py +0 -0
  68. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/tree_manager/factory.py +0 -0
  69. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/tree_manager/tree_expander.py +0 -0
  70. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/trees/__init__.py +0 -0
  71. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/trees/descendants.py +0 -0
  72. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/trees/factory.py +0 -0
  73. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/trees/tree.py +0 -0
  74. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/trees/tree_visualization.py +0 -0
  75. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/updates/__init__.py +0 -0
  76. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/updates/algorithm_node_updater.py +0 -0
  77. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/updates/factory.py +0 -0
  78. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/updates/index_block.py +0 -0
  79. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/updates/index_updater.py +0 -0
  80. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/updates/minmax_evaluation_updater.py +0 -0
  81. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/updates/updates_file.py +0 -0
  82. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/updates/value_block.py +0 -0
  83. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/utils/comparable.py +0 -0
  84. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/utils/dataclass.py +0 -0
  85. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/utils/dict_of_numbered_dict_with_pointer_on_max.py +0 -0
  86. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/utils/logger.py +0 -0
  87. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/utils/my_value_sorted_dict.py +0 -0
  88. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/src/anemone/utils/small_tools.py +0 -0
  89. {algorhino_anemone-0.1.3 → algorhino_anemone-0.1.5}/tests/test_indices.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: algorhino-anemone
3
- Version: 0.1.3
3
+ Version: 0.1.5
4
4
  Summary: anemone searches trees
5
5
  Author-email: Victor Gabillon <victorgabillon@gmail.com>
6
6
  License-Expression: GPL-3.0-only
@@ -12,7 +12,7 @@ Classifier: Operating System :: OS Independent
12
12
  Requires-Python: >=3.13
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
- Requires-Dist: valanga>=0.1.4
15
+ Requires-Dist: valanga>=0.1.6
16
16
  Requires-Dist: atomheart>=0.1.2
17
17
  Requires-Dist: rich
18
18
  Requires-Dist: sortedcollections>=2.1.0
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
5
5
 
6
6
  [project]
7
7
  name = "algorhino-anemone"
8
- version = "0.1.3"
8
+ version = "0.1.5"
9
9
  description = "anemone searches trees"
10
10
  keywords = ["tree", "search"]
11
11
  classifiers = [
@@ -14,7 +14,7 @@ classifiers = [
14
14
  ]
15
15
  requires-python = ">=3.13"
16
16
  dependencies = [
17
- "valanga>=0.1.4",
17
+ "valanga>=0.1.6",
18
18
  "atomheart>=0.1.2",
19
19
  "rich",
20
20
  "sortedcollections>=2.1.0",
@@ -265,7 +265,7 @@ description = "ruff + pylint (fast, no package build/install)"
265
265
  package = "skip"
266
266
  deps = [
267
267
  # runtime deps needed for pylint imports (match [project].dependencies)
268
- "valanga>=0.1.4",
268
+ "valanga>=0.1.6",
269
269
  "atomheart>=0.1.2",
270
270
  "rich",
271
271
  "sortedcollections>=2.1.0",
@@ -290,7 +290,7 @@ description = "mypy + pyright (fast, no package build/install)"
290
290
  package = "skip"
291
291
  deps = [
292
292
  # runtime deps for import resolution
293
- "valanga>=0.1.4",
293
+ "valanga>=0.1.6",
294
294
  "atomheart>=0.1.2",
295
295
  "rich",
296
296
  "sortedcollections>=2.1.0",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: algorhino-anemone
3
- Version: 0.1.3
3
+ Version: 0.1.5
4
4
  Summary: anemone searches trees
5
5
  Author-email: Victor Gabillon <victorgabillon@gmail.com>
6
6
  License-Expression: GPL-3.0-only
@@ -12,7 +12,7 @@ Classifier: Operating System :: OS Independent
12
12
  Requires-Python: >=3.13
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
- Requires-Dist: valanga>=0.1.4
15
+ Requires-Dist: valanga>=0.1.6
16
16
  Requires-Dist: atomheart>=0.1.2
17
17
  Requires-Dist: rich
18
18
  Requires-Dist: sortedcollections>=2.1.0
@@ -1,4 +1,4 @@
1
- valanga>=0.1.4
1
+ valanga>=0.1.6
2
2
  atomheart>=0.1.2
3
3
  rich
4
4
  sortedcollections>=2.1.0
@@ -0,0 +1,6 @@
1
+ """Basic types and protocols for Anemone."""
2
+
3
+ from typing import Annotated
4
+
5
+ type Seed = Annotated[int, "seed"]
6
+ type TreeDepth = Annotated[int, "Depth level of a node in a tree structure"]
@@ -7,7 +7,8 @@ from queue import Queue
7
7
  from random import Random
8
8
  from typing import Literal, Type
9
9
 
10
- from valanga import ContentRepresentation, RepresentationFactory, TurnState
10
+ from valanga import RepresentationFactory, TurnState
11
+ from valanga.evaluator_types import EvaluatorInput
11
12
 
12
13
  from anemone import node_factory
13
14
  from anemone import search_factory as search_factories
@@ -56,7 +57,7 @@ def create_tree_and_value_branch_selector[StateT: TurnState](
56
57
  args: TreeAndValuePlayerArgs,
57
58
  random_generator: Random,
58
59
  master_state_evaluator: MasterStateEvaluator,
59
- state_representation_factory: RepresentationFactory[ContentRepresentation] | None,
60
+ state_representation_factory: RepresentationFactory[StateT, EvaluatorInput] | None,
60
61
  queue_progress_player: Queue[IsDataclass] | None,
61
62
  ) -> TreeAndValueBranchSelector[StateT]:
62
63
  """Convenience constructor using the default minmax tree evaluation.
@@ -85,7 +86,7 @@ def create_tree_and_value_branch_selector_with_tree_eval_factory[StateT: TurnSta
85
86
  args: TreeAndValuePlayerArgs,
86
87
  random_generator: Random,
87
88
  master_state_evaluator: MasterStateEvaluator,
88
- state_representation_factory: RepresentationFactory[ContentRepresentation] | None,
89
+ state_representation_factory: RepresentationFactory[StateT, EvaluatorInput] | None,
89
90
  node_tree_evaluation_factory: NodeTreeEvaluationFactory[StateT],
90
91
  queue_progress_player: Queue[IsDataclass] | None,
91
92
  ) -> TreeAndValueBranchSelector[StateT]:
@@ -89,7 +89,7 @@ class MasterStateEvaluator(Protocol):
89
89
  class NodeDirectEvaluator[StateT: State = State]:
90
90
  """
91
91
  The NodeEvaluator class is responsible for evaluating the value of nodes in a tree structure.
92
- It uses a board evaluator and a syzygy evaluator to calculate the value of the nodes.
92
+ It uses a state evaluator and a syzygy evaluator to calculate the value of the nodes.
93
93
  """
94
94
 
95
95
  master_state_evaluator: MasterStateEvaluator
@@ -140,7 +140,7 @@ class NodeMinmaxEvaluation[
140
140
  return self.value_white_minmax
141
141
 
142
142
  def set_evaluation(self, evaluation: float) -> None:
143
- """sets the evaluation from the board evaluator
143
+ """Set the evaluation from the state evaluator.
144
144
 
145
145
  Args:
146
146
  evaluation (float): The evaluation value to be set.
@@ -876,6 +876,7 @@ class NodeMinmaxEvaluation[
876
876
 
877
877
  def evaluate(self) -> StateEvaluation:
878
878
  """Build a StateEvaluation from current minmax state."""
879
+
879
880
  if self.over_event.is_over():
880
881
  return ForcedOutcome(
881
882
  outcome=self.over_event,
@@ -43,7 +43,7 @@ class NodeTreeEvaluation[StateT: State = State](Protocol):
43
43
  value_white_minmax: float | None = None
44
44
 
45
45
  def set_evaluation(self, evaluation: float) -> None:
46
- """sets the evaluation from the board evaluator
46
+ """Set the evaluation from the state evaluator.
47
47
 
48
48
  Args:
49
49
  evaluation (float): The evaluation value to be set.
@@ -12,6 +12,7 @@ from valanga import (
12
12
  State,
13
13
  StateModifications,
14
14
  )
15
+ from valanga.evaluator_types import EvaluatorInput
15
16
 
16
17
  from anemone.basics import TreeDepth
17
18
  from anemone.indices import node_indices
@@ -37,7 +38,7 @@ class AlgorithmNodeFactory[StateT: State = State]:
37
38
  """
38
39
 
39
40
  tree_node_factory: TreeNodeFactory[AlgorithmNode[StateT], StateT]
40
- state_representation_factory: RepresentationFactory | None
41
+ state_representation_factory: RepresentationFactory[StateT, EvaluatorInput] | None
41
42
  node_tree_evaluation_factory: NodeTreeEvaluationFactory[StateT]
42
43
  exploration_index_data_create: node_indices.ExplorationIndexDataFactory[
43
44
  AlgorithmNode[StateT], StateT
@@ -60,7 +61,9 @@ class AlgorithmNodeFactory[StateT: State = State]:
60
61
  node_indices.NodeExplorationData[AlgorithmNode[StateT], StateT] | None
61
62
  ) = self.exploration_index_data_create(tree_node)
62
63
 
63
- state_representation: ContentRepresentation | None = None
64
+ state_representation: ContentRepresentation[StateT, EvaluatorInput] | None = (
65
+ None
66
+ )
64
67
  if self.state_representation_factory is not None:
65
68
  if parent_node is not None:
66
69
  parent_node_representation = parent_node.state_representation
@@ -12,6 +12,7 @@ from valanga import (
12
12
  State,
13
13
  StateTag,
14
14
  )
15
+ from valanga.evaluator_types import EvaluatorInput
15
16
 
16
17
  from anemone.indices.node_indices import NodeExplorationData
17
18
  from anemone.node_evaluation.node_tree_evaluation.node_tree_evaluation import (
@@ -33,11 +34,13 @@ class AlgorithmNode[StateT: State = State]:
33
34
  NodeExplorationData[Self, StateT] | None
34
35
  ) # the object storing the information to help the algorithm decide the next nodes to explore
35
36
  _state_representation: (
36
- ContentRepresentation | None
37
+ ContentRepresentation[StateT, EvaluatorInput] | None
37
38
  ) # the state representation for evaluation
38
39
 
39
40
  @property
40
- def state_representation(self) -> ContentRepresentation | None:
41
+ def state_representation(
42
+ self,
43
+ ) -> ContentRepresentation[StateT, EvaluatorInput] | None:
41
44
  """
42
45
  Returns the state representation.
43
46
  """
@@ -48,7 +51,7 @@ class AlgorithmNode[StateT: State = State]:
48
51
  tree_node: TreeNode[Self, StateT],
49
52
  tree_evaluation: NodeTreeEvaluation[StateT],
50
53
  exploration_index_data: NodeExplorationData[Self, StateT] | None,
51
- state_representation: ContentRepresentation | None,
54
+ state_representation: ContentRepresentation[StateT, EvaluatorInput] | None,
52
55
  ) -> None:
53
56
  """
54
57
  Initializes an AlgorithmNode object.
@@ -57,7 +60,7 @@ class AlgorithmNode[StateT: State = State]:
57
60
  tree_node (TreeNode): The tree node that is wrapped.
58
61
  tree_evaluation (NodeTreeEvaluation): The object computing the value.
59
62
  exploration_index_data (NodeExplorationData | None): The object storing the information to help the algorithm decide the next nodes to explore.
60
- state_representation (StateRepresentation | None): The board representation.
63
+ state_representation (ContentRepresentation | None): The state representation used for evaluation.
61
64
  """
62
65
  self.tree_node = tree_node
63
66
  self.tree_evaluation = tree_evaluation
@@ -147,7 +150,7 @@ class AlgorithmNode[StateT: State = State]:
147
150
  @property
148
151
  def all_branches_keys(self) -> BranchKeyGeneratorP[BranchKey]:
149
152
  """
150
- Returns a generator that yields the branch keys for the current board state.
153
+ Returns a generator that yields the branch keys for the current state.
151
154
 
152
155
  Returns:
153
156
  BranchKeyGenerator: A generator that yields the branch keys.
@@ -49,7 +49,7 @@ class TreeAndValueBranchSelector[StateT: TurnState = TurnState]:
49
49
  Selects the best branch based on the tree and value strategy.
50
50
 
51
51
  Args:
52
- - board: The current board state.
52
+ - state: The current state to explore.
53
53
  - selection_seed: The seed used for randomization during branch selection.
54
54
 
55
55
  Returns:
@@ -70,7 +70,7 @@ class TreeManager[
70
70
  Returns:
71
71
  The tree expansion object.
72
72
  """
73
- # The parent board is copied, we only copy the stack (history of previous board) if the depth is smaller than 2
73
+ # The parent state is copied; we only copy the stack (history of previous states) if the depth is smaller than 2.
74
74
  # Having the stack information allows checking for draw by repetition.
75
75
  # To limit computation we limit copying it all the time. The resulting policy will only be aware of immediate
76
76
  # risk of draw by repetition
@@ -117,7 +117,7 @@ class TreeManager[
117
117
  The tree expansion object.
118
118
  """
119
119
 
120
- # Creation of the child node. If the board already exited in another node, that node is returned as child_node.
120
+ # Creation of the child node. If the state already existed in another node, that node is returned as child_node.
121
121
  tree_depth: int = parent_node.tree_depth + 1
122
122
  state_tag: StateTag = state.tag
123
123
 
@@ -1,23 +0,0 @@
1
- """Basic types and protocols for Anemone."""
2
-
3
- from typing import Annotated, Protocol
4
-
5
- from valanga import Color, HasTurn, State
6
-
7
- type Seed = Annotated[int, "seed"]
8
- type TreeDepth = Annotated[int, "Depth level of a node in a tree structure"]
9
-
10
-
11
- class StateWithTurn(State, HasTurn, Protocol):
12
- """A `valanga.State` that also exposes turn information."""
13
-
14
- ...
15
-
16
-
17
- class HasBlackAndWhiteTurn(Protocol):
18
- """Protocol for state that has black and white turns."""
19
-
20
- @property
21
- def turn(self) -> Color:
22
- """Return the current player's turn color."""
23
- ...