anemone searches trees
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file algorhino_anemone-0.2.15.tar.gz.
File metadata
- Download URL: algorhino_anemone-0.2.15.tar.gz
- Upload date:
- Size: 316.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eddef61ed2e972a48b570654f9819887950c92a4aa3fab2672359e2ff699e9e1
|
|
| MD5 |
168cf58b79ac8f81cf407b170c78e3c9
|
|
| BLAKE2b-256 |
b641b146b50d52afc0c1368fc7914d80f8fbe4aaa3ff0fd60fdd708fa039882d
|
Provenance
The following attestation bundles were made for algorhino_anemone-0.2.15.tar.gz:
Publisher:
release.yml on victorgabillon/anemone
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
algorhino_anemone-0.2.15.tar.gz -
Subject digest:
eddef61ed2e972a48b570654f9819887950c92a4aa3fab2672359e2ff699e9e1 - Sigstore transparency entry: 1368080896
- Sigstore integration time:
-
Permalink:
victorgabillon/anemone@bfad9704a5bb8557cfc5b44b3c36d97e3ba25416 -
Branch / Tag:
refs/tags/v0.2.16 - Owner: https://github.com/victorgabillon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@bfad9704a5bb8557cfc5b44b3c36d97e3ba25416 -
Trigger Event:
push
-
Statement type:
File details
Details for the file algorhino_anemone-0.2.15-py3-none-any.whl.
File metadata
- Download URL: algorhino_anemone-0.2.15-py3-none-any.whl
- Upload date:
- Size: 334.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
edfb76134589e7e9ae3d74768580e8bbb436b7eb559ed05e4f376264bebb8c33
|
|
| MD5 |
6d319757ab6706d2fe13fa0dcfa4fcf4
|
|
| BLAKE2b-256 |
4d027d9341f283072cbeec2e3c2a4995ade7a839ea465616699f0ccbce14fc02
|
Provenance
The following attestation bundles were made for algorhino_anemone-0.2.15-py3-none-any.whl:
Publisher:
release.yml on victorgabillon/anemone
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
algorhino_anemone-0.2.15-py3-none-any.whl -
Subject digest:
edfb76134589e7e9ae3d74768580e8bbb436b7eb559ed05e4f376264bebb8c33 - Sigstore transparency entry: 1368080915
- Sigstore integration time:
-
Permalink:
victorgabillon/anemone@bfad9704a5bb8557cfc5b44b3c36d97e3ba25416 -
Branch / Tag:
refs/tags/v0.2.16 - Owner: https://github.com/victorgabillon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@bfad9704a5bb8557cfc5b44b3c36d97e3ba25416 -
Trigger Event:
push
-
Statement type: