algorhino-anemone 0.1.3__py3-none-any.whl → 0.1.4__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.
- {algorhino_anemone-0.1.3.dist-info → algorhino_anemone-0.1.4.dist-info}/METADATA +1 -1
- {algorhino_anemone-0.1.3.dist-info → algorhino_anemone-0.1.4.dist-info}/RECORD +13 -13
- {algorhino_anemone-0.1.3.dist-info → algorhino_anemone-0.1.4.dist-info}/WHEEL +1 -1
- anemone/factory.py +4 -2
- anemone/node_evaluation/node_direct_evaluation/node_direct_evaluator.py +1 -1
- anemone/node_evaluation/node_tree_evaluation/node_minmax_evaluation.py +2 -1
- anemone/node_evaluation/node_tree_evaluation/node_tree_evaluation.py +1 -1
- anemone/node_factory/algorithm_node_factory.py +3 -1
- anemone/nodes/algorithm_node/algorithm_node.py +2 -2
- anemone/tree_and_value_branch_selector.py +1 -1
- anemone/tree_manager/tree_manager.py +2 -2
- {algorhino_anemone-0.1.3.dist-info → algorhino_anemone-0.1.4.dist-info}/licenses/LICENSE +0 -0
- {algorhino_anemone-0.1.3.dist-info → algorhino_anemone-0.1.4.dist-info}/top_level.txt +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
algorhino_anemone-0.1.
|
|
1
|
+
algorhino_anemone-0.1.4.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
2
2
|
anemone/__init__.py,sha256=iKX9OGJxbyIqe9Fy-xxZY6sdH7WcG4RFyPR0WBai7Ls,942
|
|
3
3
|
anemone/basics.py,sha256=plCN-SfAcCj4TPDVD3r19Q36UFjiKmNvuEyPH0kQ7Qs,574
|
|
4
|
-
anemone/factory.py,sha256=
|
|
4
|
+
anemone/factory.py,sha256=seGZuwQNzfdSV7moN-kwqDGp0EfEY0srS0awHAR7mvk,6044
|
|
5
5
|
anemone/state_transition.py,sha256=fxvHZOYRtWV5ExXRIoehdRg9qV6zhgiE5uiCeOc80Dc,1418
|
|
6
|
-
anemone/tree_and_value_branch_selector.py,sha256=
|
|
6
|
+
anemone/tree_and_value_branch_selector.py,sha256=9m7cWzw_nsFKiqZ4l7B2fz0lZ9HZ2NUNH2flZpaaQvQ,3479
|
|
7
7
|
anemone/tree_exploration.py,sha256=cg1iTp3j9p9jUNjm07ogbflX8VC15AV8GEhGz3g1YNU,10529
|
|
8
8
|
anemone/indices/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
9
|
anemone/indices/index_manager/__init__.py,sha256=P49ofGrnP_Nfmv63Rg_-Zvwn5NFvFFDQ3MD3GMeWNWw,515
|
|
@@ -17,12 +17,12 @@ anemone/nn/torch_evaluator.py,sha256=cXcaldEI5S8JE1Yy9aNUamVEK3DPsPmBmGeUi9611zU
|
|
|
17
17
|
anemone/node_evaluation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
18
|
anemone/node_evaluation/node_direct_evaluation/__init__.py,sha256=2_YwJ3oe0KBfIc3Hs-FLz093RLZsTG-VaNmecLceoiY,898
|
|
19
19
|
anemone/node_evaluation/node_direct_evaluation/factory.py,sha256=lpFmBJkIGAnar5-pQ1vMze9jUFKFchp5Pg2S8eK-ABM,470
|
|
20
|
-
anemone/node_evaluation/node_direct_evaluation/node_direct_evaluator.py,sha256=
|
|
21
|
-
anemone/node_evaluation/node_tree_evaluation/node_minmax_evaluation.py,sha256=
|
|
22
|
-
anemone/node_evaluation/node_tree_evaluation/node_tree_evaluation.py,sha256=
|
|
20
|
+
anemone/node_evaluation/node_direct_evaluation/node_direct_evaluator.py,sha256=EU9idWUGVjVBclnSiGE-3OZvvV9a7nhUZKTJCnOBhqw,5787
|
|
21
|
+
anemone/node_evaluation/node_tree_evaluation/node_minmax_evaluation.py,sha256=JuD1yg15l-FONW85s3rkp9mD1a1Y_kCZoiqI4-DGlg0,35127
|
|
22
|
+
anemone/node_evaluation/node_tree_evaluation/node_tree_evaluation.py,sha256=fHAKN_8vriERrfKfr_qDH-y7El6HBYFXHOe9eFFCDUw,4260
|
|
23
23
|
anemone/node_evaluation/node_tree_evaluation/node_tree_evaluation_factory.py,sha256=UY1glqflqMOqOPAHhtuzJ8QhGOp55Y9InqdhCMt9KJ8,1279
|
|
24
24
|
anemone/node_factory/__init__.py,sha256=qhbX58hu8-TdFof5zo3ibfPFvF-OWNSgJf3RDMrtyTQ,553
|
|
25
|
-
anemone/node_factory/algorithm_node_factory.py,sha256=
|
|
25
|
+
anemone/node_factory/algorithm_node_factory.py,sha256=DfFRIJAdycwJ1CROXVdvEbyJAmVzjN_UBqF3BhT5pIs,3994
|
|
26
26
|
anemone/node_factory/base.py,sha256=t_immiv-BDrPeQTUiOqvZLSlUq0zA2IbnM5Rweqv_n8,2134
|
|
27
27
|
anemone/node_selector/__init__.py,sha256=DThR5UV-4WZG4PT5Lo0RPv9_P83ixFGfOSFoGihKtuA,1320
|
|
28
28
|
anemone/node_selector/branch_explorer.py,sha256=3ywYkJe2R1Dg5nhmDXCgyhex85bT39Ql7ifRY--9Z_A,2677
|
|
@@ -45,7 +45,7 @@ anemone/nodes/tree_node.py,sha256=C9jKzA62ToYhANYjwhS2qPAHti81l-x-p7RmKe6Sb0Q,77
|
|
|
45
45
|
anemone/nodes/tree_traversal.py,sha256=sE9as_8-74bIUuAYNhk2MK6VvlrN1Y3mFExff_HGpQ8,3958
|
|
46
46
|
anemone/nodes/utils.py,sha256=_NPGFnjzouFMpepyNPw5D0d3999_F3tmJHa0bafwo7M,4501
|
|
47
47
|
anemone/nodes/algorithm_node/__init__.py,sha256=8cNk3PmDzd22K78YWiO29Mu5A1FCObzPwEfWE1ym6Jk,116
|
|
48
|
-
anemone/nodes/algorithm_node/algorithm_node.py,sha256=
|
|
48
|
+
anemone/nodes/algorithm_node/algorithm_node.py,sha256=DUJIVM9PdSRndeir9lPe5e9ebiu9lNx27c0z819Rw64,6544
|
|
49
49
|
anemone/progress_monitor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
50
50
|
anemone/progress_monitor/progress_monitor.py,sha256=ExuvwOntZBwrBjIbNr8ZpeCd2F5s21rsX74FFog7gqY,10896
|
|
51
51
|
anemone/recommender_rule/__init__.py,sha256=9K73T0bkpvHg0IsQc1OW8QgsUhCNYq9ceqPMkwdqE8c,347
|
|
@@ -56,7 +56,7 @@ anemone/tree_manager/__init__.py,sha256=D3j8emzRNF1fkPTpNUPsXbqAzMM9SyI3Ty_4Y_b2
|
|
|
56
56
|
anemone/tree_manager/algorithm_node_tree_manager.py,sha256=ekDfS4lfYGP9tNtUGre6DGz0haHi3-MZuUVO-kF0JQU,8801
|
|
57
57
|
anemone/tree_manager/factory.py,sha256=d10uuf5DtHZ_jKT7Z688Wd3_a7TewwmUywlTeWdUQwc,2679
|
|
58
58
|
anemone/tree_manager/tree_expander.py,sha256=LpKFDKsOrW0cq09m11aXQZV82s10iyiizQafRBHQ7ts,4041
|
|
59
|
-
anemone/tree_manager/tree_manager.py,sha256=
|
|
59
|
+
anemone/tree_manager/tree_manager.py,sha256=QJAKOyln-zPSAwGbcyX3OTnHW-lawshOgwxp69j_sN0,8284
|
|
60
60
|
anemone/trees/__init__.py,sha256=FtX6ZDfZI7JDjv6IAgKRVytJmafL3Vod3RF7L-bDTWc,269
|
|
61
61
|
anemone/trees/descendants.py,sha256=bq8GrckFsPpteWr68og4a5KA94hYWn-qrDzC6dDfOKw,27249
|
|
62
62
|
anemone/trees/factory.py,sha256=GIZcojZzxl5VG6lEpxxF9PV8VZnS-c18xWxg0dza0r8,2180
|
|
@@ -76,7 +76,7 @@ anemone/utils/dict_of_numbered_dict_with_pointer_on_max.py,sha256=s5Z-O5mBwJUh4P
|
|
|
76
76
|
anemone/utils/logger.py,sha256=bJQ8COqdn5obtbi8TuokQHmdHpp57XRksTmfvCLLfyM,2973
|
|
77
77
|
anemone/utils/my_value_sorted_dict.py,sha256=LbqtpBSCS7VrUTUChWCsi18IKZj65FkTJREqbl-xSVA,619
|
|
78
78
|
anemone/utils/small_tools.py,sha256=l9dy5Oqvuvg8qQXqJUfyb3uwBHwVGVrKz6WeTHjyLTk,2766
|
|
79
|
-
algorhino_anemone-0.1.
|
|
80
|
-
algorhino_anemone-0.1.
|
|
81
|
-
algorhino_anemone-0.1.
|
|
82
|
-
algorhino_anemone-0.1.
|
|
79
|
+
algorhino_anemone-0.1.4.dist-info/METADATA,sha256=beVHIe1Er6XUzU7LmxPcJTvD9x9TMCJAOzrfDES-5kw,5691
|
|
80
|
+
algorhino_anemone-0.1.4.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
|
|
81
|
+
algorhino_anemone-0.1.4.dist-info/top_level.txt,sha256=G1vbB-vAevQVde3UZ5X1_Ysy1_6sJDEueHRi2qcDgrY,8
|
|
82
|
+
algorhino_anemone-0.1.4.dist-info/RECORD,,
|
anemone/factory.py
CHANGED
|
@@ -56,7 +56,8 @@ def create_tree_and_value_branch_selector[StateT: TurnState](
|
|
|
56
56
|
args: TreeAndValuePlayerArgs,
|
|
57
57
|
random_generator: Random,
|
|
58
58
|
master_state_evaluator: MasterStateEvaluator,
|
|
59
|
-
state_representation_factory: RepresentationFactory[ContentRepresentation]
|
|
59
|
+
state_representation_factory: RepresentationFactory[StateT, ContentRepresentation]
|
|
60
|
+
| 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,8 @@ 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]
|
|
89
|
+
state_representation_factory: RepresentationFactory[StateT, ContentRepresentation]
|
|
90
|
+
| None,
|
|
89
91
|
node_tree_evaluation_factory: NodeTreeEvaluationFactory[StateT],
|
|
90
92
|
queue_progress_player: Queue[IsDataclass] | None,
|
|
91
93
|
) -> 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
|
|
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
|
-
"""
|
|
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
|
-
"""
|
|
46
|
+
"""Set the evaluation from the state evaluator.
|
|
47
47
|
|
|
48
48
|
Args:
|
|
49
49
|
evaluation (float): The evaluation value to be set.
|
|
@@ -37,7 +37,9 @@ class AlgorithmNodeFactory[StateT: State = State]:
|
|
|
37
37
|
"""
|
|
38
38
|
|
|
39
39
|
tree_node_factory: TreeNodeFactory[AlgorithmNode[StateT], StateT]
|
|
40
|
-
state_representation_factory:
|
|
40
|
+
state_representation_factory: (
|
|
41
|
+
RepresentationFactory[StateT, ContentRepresentation] | None
|
|
42
|
+
)
|
|
41
43
|
node_tree_evaluation_factory: NodeTreeEvaluationFactory[StateT]
|
|
42
44
|
exploration_index_data_create: node_indices.ExplorationIndexDataFactory[
|
|
43
45
|
AlgorithmNode[StateT], StateT
|
|
@@ -57,7 +57,7 @@ class AlgorithmNode[StateT: State = State]:
|
|
|
57
57
|
tree_node (TreeNode): The tree node that is wrapped.
|
|
58
58
|
tree_evaluation (NodeTreeEvaluation): The object computing the value.
|
|
59
59
|
exploration_index_data (NodeExplorationData | None): The object storing the information to help the algorithm decide the next nodes to explore.
|
|
60
|
-
state_representation (
|
|
60
|
+
state_representation (ContentRepresentation | None): The state representation used for evaluation.
|
|
61
61
|
"""
|
|
62
62
|
self.tree_node = tree_node
|
|
63
63
|
self.tree_evaluation = tree_evaluation
|
|
@@ -147,7 +147,7 @@ class AlgorithmNode[StateT: State = State]:
|
|
|
147
147
|
@property
|
|
148
148
|
def all_branches_keys(self) -> BranchKeyGeneratorP[BranchKey]:
|
|
149
149
|
"""
|
|
150
|
-
Returns a generator that yields the branch keys for the current
|
|
150
|
+
Returns a generator that yields the branch keys for the current state.
|
|
151
151
|
|
|
152
152
|
Returns:
|
|
153
153
|
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
|
-
-
|
|
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
|
|
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
|
|
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
|
|
|
File without changes
|
|
File without changes
|