algorhino-anemone 0.1.9__py3-none-any.whl → 0.1.10__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.9.dist-info → algorhino_anemone-0.1.10.dist-info}/METADATA +3 -3
- {algorhino_anemone-0.1.9.dist-info → algorhino_anemone-0.1.10.dist-info}/RECORD +9 -9
- {algorhino_anemone-0.1.9.dist-info → algorhino_anemone-0.1.10.dist-info}/WHEEL +1 -1
- anemone/basics.py +18 -1
- anemone/factory.py +3 -7
- anemone/node_factory/algorithm_node_factory.py +1 -1
- anemone/tree_and_value_branch_selector.py +2 -2
- {algorhino_anemone-0.1.9.dist-info → algorhino_anemone-0.1.10.dist-info}/licenses/LICENSE +0 -0
- {algorhino_anemone-0.1.9.dist-info → algorhino_anemone-0.1.10.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: algorhino-anemone
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.10
|
|
4
4
|
Summary: anemone searches trees
|
|
5
5
|
Author-email: Victor Gabillon <victorgabillon@gmail.com>
|
|
6
6
|
License-Expression: GPL-3.0-only
|
|
@@ -12,8 +12,8 @@ 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.
|
|
16
|
-
Requires-Dist: atomheart>=0.1.
|
|
15
|
+
Requires-Dist: valanga>=0.1.13
|
|
16
|
+
Requires-Dist: atomheart>=0.1.6
|
|
17
17
|
Requires-Dist: rich
|
|
18
18
|
Requires-Dist: sortedcollections>=2.1.0
|
|
19
19
|
Requires-Dist: graphviz
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
algorhino_anemone-0.1.
|
|
1
|
+
algorhino_anemone-0.1.10.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
2
2
|
anemone/__init__.py,sha256=iKX9OGJxbyIqe9Fy-xxZY6sdH7WcG4RFyPR0WBai7Ls,942
|
|
3
|
-
anemone/basics.py,sha256=
|
|
4
|
-
anemone/factory.py,sha256=
|
|
3
|
+
anemone/basics.py,sha256=plCN-SfAcCj4TPDVD3r19Q36UFjiKmNvuEyPH0kQ7Qs,574
|
|
4
|
+
anemone/factory.py,sha256=V4uretydlF0ykyq4ybn28GkctrOv7-78RSsxOJsQgPg,6146
|
|
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=2K3AprInjzTIMm1sQsL4B33hljZcT-ToQfwpQrrRk5o,3455
|
|
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
|
|
@@ -22,7 +22,7 @@ anemone/node_evaluation/node_tree_evaluation/node_minmax_evaluation.py,sha256=Ju
|
|
|
22
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=Pz0YYPqsuKaRiOhL9gJdEBPXEFepZNr_mZ_Ib94OVHs,4106
|
|
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
|
|
@@ -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.10.dist-info/METADATA,sha256=Z1k54ME5SXYqL4aFeYt4157f7ikwIZslHJS0eV6md58,5693
|
|
80
|
+
algorhino_anemone-0.1.10.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
81
|
+
algorhino_anemone-0.1.10.dist-info/top_level.txt,sha256=G1vbB-vAevQVde3UZ5X1_Ysy1_6sJDEueHRi2qcDgrY,8
|
|
82
|
+
algorhino_anemone-0.1.10.dist-info/RECORD,,
|
anemone/basics.py
CHANGED
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
"""Basic types and protocols for Anemone."""
|
|
2
2
|
|
|
3
|
-
from typing import Annotated
|
|
3
|
+
from typing import Annotated, Protocol
|
|
4
|
+
|
|
5
|
+
from valanga import Color, HasTurn, State
|
|
4
6
|
|
|
5
7
|
type Seed = Annotated[int, "seed"]
|
|
6
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
|
+
...
|
anemone/factory.py
CHANGED
|
@@ -7,11 +7,7 @@ from queue import Queue
|
|
|
7
7
|
from random import Random
|
|
8
8
|
from typing import Literal, Type
|
|
9
9
|
|
|
10
|
-
from valanga import
|
|
11
|
-
RepresentationFactory,
|
|
12
|
-
StateModifications,
|
|
13
|
-
TurnState,
|
|
14
|
-
)
|
|
10
|
+
from valanga import RepresentationFactory, StateModifications, TurnState
|
|
15
11
|
from valanga.evaluator_types import EvaluatorInput
|
|
16
12
|
|
|
17
13
|
from anemone import node_factory
|
|
@@ -62,7 +58,7 @@ def create_tree_and_value_branch_selector[StateT: TurnState](
|
|
|
62
58
|
random_generator: Random,
|
|
63
59
|
master_state_evaluator: MasterStateEvaluator,
|
|
64
60
|
state_representation_factory: RepresentationFactory[
|
|
65
|
-
StateT,
|
|
61
|
+
StateT, EvaluatorInput, StateModifications
|
|
66
62
|
]
|
|
67
63
|
| None,
|
|
68
64
|
queue_progress_player: Queue[IsDataclass] | None,
|
|
@@ -94,7 +90,7 @@ def create_tree_and_value_branch_selector_with_tree_eval_factory[StateT: TurnSta
|
|
|
94
90
|
random_generator: Random,
|
|
95
91
|
master_state_evaluator: MasterStateEvaluator,
|
|
96
92
|
state_representation_factory: RepresentationFactory[
|
|
97
|
-
StateT,
|
|
93
|
+
StateT, EvaluatorInput, StateModifications
|
|
98
94
|
]
|
|
99
95
|
| None,
|
|
100
96
|
node_tree_evaluation_factory: NodeTreeEvaluationFactory[StateT],
|
|
@@ -39,7 +39,7 @@ class AlgorithmNodeFactory[StateT: State = State]:
|
|
|
39
39
|
|
|
40
40
|
tree_node_factory: TreeNodeFactory[AlgorithmNode[StateT], StateT]
|
|
41
41
|
state_representation_factory: (
|
|
42
|
-
RepresentationFactory[StateT,
|
|
42
|
+
RepresentationFactory[StateT, EvaluatorInput, StateModifications] | None
|
|
43
43
|
)
|
|
44
44
|
node_tree_evaluation_factory: NodeTreeEvaluationFactory[StateT]
|
|
45
45
|
exploration_index_data_create: node_indices.ExplorationIndexDataFactory[
|
|
@@ -44,7 +44,7 @@ class TreeAndValueBranchSelector[StateT: TurnState = TurnState]:
|
|
|
44
44
|
recommend_branch_after_exploration: recommender_rule.AllRecommendFunctionsArgs
|
|
45
45
|
queue_progress_player: Queue[IsDataclass] | None
|
|
46
46
|
|
|
47
|
-
def
|
|
47
|
+
def recommend(self, state: StateT, seed: Seed) -> Recommendation:
|
|
48
48
|
"""
|
|
49
49
|
Selects the best branch based on the tree and value strategy.
|
|
50
50
|
|
|
@@ -56,7 +56,7 @@ class TreeAndValueBranchSelector[StateT: TurnState = TurnState]:
|
|
|
56
56
|
- The recommended branch based on the tree and value strategy.
|
|
57
57
|
"""
|
|
58
58
|
tree_exploration: TreeExploration = self.create_tree_exploration(state=state)
|
|
59
|
-
self.random_generator.seed(
|
|
59
|
+
self.random_generator.seed(seed)
|
|
60
60
|
|
|
61
61
|
branch_recommendation: Recommendation = tree_exploration.explore(
|
|
62
62
|
random_generator=self.random_generator
|
|
File without changes
|
|
File without changes
|