Skip to content
fbk-psoPublic

About

Heuristic Search Temporal and Numeric Planner

Resources

Code of conduct

Contributing

Stars

8 stars

Watchers

4 watching

Forks

Repository files navigation

TamerLite

TamerLite is a heuristic search-based temporal planner designed to address planning problems with rich temporal dynamics. It is capable of handling Intermediate Conditions and Effects (ICE), allowing it to model actions that have requirements and consequences not only at their start or end, but also at intermediate points during their execution. This makes TamerLite suitable for complex real-world scenarios where temporal expressiveness is crucial.

Installation

pip install "tamerlite[rust]"   # pure-Python wrapper + Rust acceleration wheel
# or
pip install tamerlite           # pure-Python only (slower; no Rust toolchain needed)

To try the latest unreleased build, install a wheel directly from the rolling dev pre-release:

pip install --pre <url-of-wheel-on-dev-release>

Install from source

git clone https://github.com/fbk-pso/tamerlite.git
cd tamerlite
pip install ./crates/rustamer   # builds the Rust acceleration wheel (requires a Rust toolchain + maturin)
pip install .                   # installs the tamerlite Python wheel

For a contributor setup (uv + just + pre-commit + dev tools), see CONTRIBUTING.md instead.

Note: the Rust acceleration is optional. If rustamer is not installed, or if you set the environment variable DISABLE_RUSTAMER=1, TamerLite transparently falls back to a slower pure-Python implementation.

Usage

TamerLite is fully integrated with the Unified Planning framework. Register the planner engine with the Unified Planning environment:

from unified_planning.shortcuts import *

env = get_environment()
env.factory.add_engine("tamerlite", "tamerlite.engine", "TamerLite")

problem = ...  # your temporal planning problem

with OneshotPlanner(name="tamerlite") as planner:
    result = planner.solve(problem)
    print(result.plan)

Parameters

TamerLite supports configurable search strategies via structured parameter classes. The main options are SearchParams for a single search configuration, and MultiqueueParams for combining multiple strategies.

SearchParams

Defines parameters for a single search strategy.

Field Type Description
search Optional[str] Search algorithm to use. Supported values: "astar", "wastar", "gbfs", "bfs", "dfs", "ehc", "novbfs_hg", "novbfs_lg". Default: "wastar". "novbfs_hg"/"novbfs_lg" (partitioned numeric novelty search, cost-maximizing/cost-minimizing final tie-break) use the configured heuristic (default "hff") both to partition novelty (floor(h)) and as a tie-breaker, and ignore weight.
heuristic Optional[str] Heuristic used by heuristic search algorithms. Supported values: "hff", "hadd", "hmax", "hmax_explicit", "blind", "custom". Default: "hff".
weight Optional[float] Heuristic weight used by weighted search variants like wastar. Must be between 0 and 1. Default: 0.8.
internal_heuristic_cache bool Enable internal caching within the heuristic. Default: True.
inadmissible_numeric_heuristic_variant bool Enable the inadmissible numeric variant for hff, hadd, hmax heuristics. Default: False.
early_termination bool Stop as soon as a generated successor state satisfies the goal, instead of waiting until the state is selected for expansion. Default: False.
weak_equality bool Use weaker state equality on temporal problems. If no plan is found, retry with weak equality disabled. Default: False.
relevant_equality bool Restrict the duplicate-state detection key to fluents that can affect search outcome, ignoring pure bookkeeping fluents. Default: True.
symmetry_breaking bool Prune equivalent symmetric states during search. Default: True.
compression_safe_actions bool Enable contiguous expansion of compression-safe temporal actions. Default: True.
relevance_analysis bool Filter out actions that cannot contribute to the goal. Default: True.
incomplete_memory_bounded_search bool Use incomplete memory-bounded variants of "wastar", "astar", "gbfs", "novbfs_hg" and "novbfs_lg". Default: False.

MultiqueueParams

Defines a multi-queue search strategy composed of multiple HeuristicParams.

Field Type Description
queues List[HeuristicParams] A list of independent heuristic configurations.
internal_heuristic_cache bool Enable internal caching within the heuristic. Default: True.
inadmissible_numeric_heuristic_variant bool Enable the inadmissible numeric variant for hff, hadd, hmax heuristics. Default: False.
early_termination bool Stop as soon as a generated successor state satisfies the goal, instead of waiting until the state is selected for expansion. Default: False.
weak_equality bool Use weaker state equality on temporal problems. If no plan is found, retry with weak equality disabled. Default: False.
symmetry_breaking bool Prune equivalent symmetric states during search. Default: True.
compression_safe_actions bool Enable contiguous expansion of compression-safe temporal actions. Default: True.
relevance_analysis bool Filter out actions that cannot contribute to the goal. Default: True.
relevant_equality bool Restrict the duplicate-state detection key to fluents that can affect search outcome, ignoring pure bookkeeping fluents. Default: True.

Example

params = SearchParams(
    search="wastar",
    heuristic="hadd",
    weight=0.8,
)

with OneshotPlanner(name="tamerlite", params={"search": params}) as planner:
    result = planner.solve(problem)
    print(result.plan)

Or using multiple queues:

multi_params = MultiqueueParams(queues=[
    HeuristicParams(heuristic="hadd", weight=0.8),
    HeuristicParams(heuristic="hmax", weight=0.5),
])

with OneshotPlanner(name="tamerlite", params={"search": multi_params}) as planner:
    result = planner.solve(problem)
    print(result.plan)

Heuristic

TamerLite also implements Unified Planning's Heuristic operation mode, exposing its delete-relaxation heuristics on Unified Planning states:

from tamerlite import HeuristicModeParams
from unified_planning.model import UPState

with Heuristic(
    problem,
    name="tamerlite",
    params={"heuristic": HeuristicModeParams(heuristic="hadd")},
) as h:
    print(h.value(UPState(problem.initial_values, problem)))

value accepts any up.model.State: the state is read only through get_value, and it is not validated. Some assumptions on the state:

  • Static fluents (fluents no action of the problem modifies) are expected to keep the values of the problem's initial state. They are never read from the state: a state that changes one is evaluated with its initial value instead.
  • Temporal problems: a UP state only holds fluent values, so it is evaluated as a state with no durative action in progress (the search state's todo is empty). Its value then counts the remaining events (action starts, ends and intermediate events) rather than actions.

The fields of HeuristicModeParams are:

Parameter Default Description
heuristic "hff" "hff", "hadd" or "hmax"
disable_numeric_reasoning False Treat every numeric condition as costing one action when false
inadmissible_numeric_heuristic_variant False Same as in SearchParams
internal_heuristic_cache False Memoize values per state (unbounded memory)

value estimates the remaining number of actions (events, on a temporal problem), whatever the quality metric, and returns None only on dead ends: the engine is GOAL_AWARE and SAFE. Problems with undefined initial numeric values, timed effects or timed goals are not supported.

Tutorial

An end-to-end runnable tutorial covering classical, numeric, temporal and temporal-numeric planning lives at tamerlite_tutorial.ipynb.

References

TamerLite is based on the following research paper:

  • Valentini, A., Micheli, A., & Cimatti, A. (2020). Temporal planning with intermediate conditions and effects. AAAI 2020

License

TamerLite is released under the GNU General Public License v3.0 (GPL-3.0). See the LICENSE file for full details.

Contributing

See CONTRIBUTING.md for the contribution workflow, dev setup, the just task runner, and the release flow. All contributors must sign our Contributor License Agreement on their first pull request and agree to follow our Code of Conduct.

Contact

For questions, bug reports, or contributions, please open an issue on GitHub or contact the authors at [email protected].

About

Heuristic Search Temporal and Numeric Planner

Resources

Code of conduct

Contributing

Stars

8 stars

Watchers

4 watching

Forks

Releases

Packages

Contributors

Languages