anemone
anemone is a Python library for tree search over valanga game states. It
separates structural tree storage, runtime search state, node evaluation,
exploration indices, and selector/opening logic so different search policies can
share one coherent runtime.
Overview
The main architectural split is:
- structure:
TreeNodeandITreeNode - runtime:
AlgorithmNodeandTreeExploration - evaluation: direct evaluation plus backed-up tree evaluation
- exploration: per-node exploration-index payloads and tree-wide recomputation
- selection: selectors and opening instructions that decide what to expand next
Installation
pip install anemone
Optional extras:
pip install anemone[nn]
pip install anemone[debug]
Debug snapshot export and the debug browser's SVG rendering also require the
system Graphviz executable (dot).
Getting started
The canonical public entry point is anemone.factory.create_search.
- Use
anemone.factoryto build a runnable search runtime. - Treat
anemone._runtime_assemblyandanemone.search_factoryas internal wiring layers behind that API. - Use
TreeAndValueBranchSelectoronly when you want the higher-level one-shot recommendation wrapper instead of driving the runtime directly.
from random import Random
from anemone.factory import SearchArgs, create_search
# Domain-specific collaborators omitted for brevity:
# - YourStateType
# - your_dynamics
# - starting_state
# - your_evaluator
# - your_selector_args
# - your_opening_type
# - your_stopping_criterion
# - your_recommender_rule
args = SearchArgs(
node_selector=your_selector_args,
opening_type=your_opening_type,
stopping_criterion=your_stopping_criterion,
recommender_rule=your_recommender_rule,
)
runtime = create_search(
state_type=YourStateType,
dynamics=your_dynamics,
starting_state=starting_state,
args=args,
random_generator=Random(0),
master_state_value_evaluator=your_evaluator,
state_representation_factory=None,
)
result = runtime.explore(Random(0))
print(result.branch_recommendation.recommended_name)
Core concepts
TreeNode: the concrete structural node storing state, depth, and links.AlgorithmNode: the runtime wrapper that adds tree evaluation and exploration-index payloads.direct_value: the immediate evaluator output for one node.backed_up_value: the subtree-derived value propagated from children.- exploration index: optional per-node search-priority data recomputed across the tree by a configured strategy.
How it works
create_search(...)assembles the runtime, direct evaluator, selector factory, tree-evaluation factory, and tree manager.- The initial tree is created with a directly evaluated root node.
- A selector chooses which node or branch to open next.
- The tree manager expands the structure and creates any new runtime nodes.
- Direct evaluation fills
direct_valueon newly created nodes. - Upward propagation recomputes
backed_up_value, branch ordering, and principal variation. - Exploration-index payloads are refreshed for the next iteration.
Documentation
Metadata
Release files for algorhino-anemone 0.2.26
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| algorhino_anemone-0.2.26.tar.gz | 436.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| algorhino_anemone-0.2.26-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 866.2 kB
Release files / algorhino_anemone-0.2.26.tar.gz
| Download URL | algorhino_anemone-0.2.26.tar.gz |
|---|---|
| Size | 436.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
281e6b9eacbaac486312825ad56065e3b002a4e15a6a9ad1b527c7cdd18af94b
|
|
BLAKE2b-256 checksum How to use checksums |
731e8ff4e8f7ba11e5954339db0edd8d64ae36a1a14a755b3e5d078085eb5ee4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.
Transparency logRelease files / algorhino_anemone-0.2.26-py3-none-any.whl
| Download URL | algorhino_anemone-0.2.26-py3-none-any.whl |
|---|---|
| Size | 430.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
98a56e6db73e93348c27aef38b9b541e68ffb451a43ccea837ad16f112009b39
|
|
BLAKE2b-256 checksum How to use checksums |
4d060d3c00ef628d2d56d0e282630252d2ee5779f38cbe3584eb1cac81ddef6c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.
Transparency log