QDpy
Loading...
Searching...
No Matches
temporal_planning.py File Reference

Feature-based diverse planning on deterministic simulators. More...

Go to the source code of this file.

Classes

class  qdpy.algorithms.temporal_planning.TemporalMonitor
 Recognize a property of the trace using finite, hashable monitor memory. More...
class  qdpy.algorithms.temporal_planning.DiversePlan
 A goal-reaching sequence and its temporal-feature truth values. More...
class  qdpy.algorithms.temporal_planning.DiversePlanningResult
 Result and search cost across all width passes. More...

Namespaces

namespace  qdpy

Functions

 qdpy.algorithms.temporal_planning.eventually (proposition)
 Recognize F p on a finite trace.
 qdpy.algorithms.temporal_planning.always (proposition)
 Recognize G p on a finite trace.
 qdpy.algorithms.temporal_planning.ordered_visit (first, second)
 Require the second proposition to hold strictly after the first.
 qdpy.algorithms.temporal_planning.feature_based_planning (start, *, actions, simulate, goal, labels, monitors, max_plans, budget, max_depth=None, state_features=None, max_width=2)
 Collect one feasible plan per temporal profile using bounded breadth-first search.

Detailed Description

Feature-based diverse planning on deterministic simulators.

See also
https://arxiv.org/abs/2510.17418

Definition in file temporal_planning.py.

Function Documentation

◆ always()

qdpy.algorithms.temporal_planning.always ( proposition)

Recognize G p on a finite trace.

Accept when proposition holds at every visited state.

Definition at line 50 of file temporal_planning.py.

◆ eventually()

qdpy.algorithms.temporal_planning.eventually ( proposition)

Recognize F p on a finite trace.

Accept when proposition holds at least once, including at the start.

Definition at line 44 of file temporal_planning.py.

◆ feature_based_planning()

qdpy.algorithms.temporal_planning.feature_based_planning ( start,
* ,
actions,
simulate,
goal,
labels,
monitors,
max_plans,
budget,
max_depth = None,
state_features = None,
max_width = 2 )

Collect one feasible plan per temporal profile using bounded breadth-first search.

Returns
DiversePlanningResult with distinct plans and exact simulator-call accounting.
Search simulator states crossed with the temporal monitor memories.

Use a pure deterministic simulate(state, action) callback on immutable,
hashable states. Return None for an illegal move. The planner stops
expanding a path at its first goal, records its Boolean profile, and
continues looking for new profiles. Reaching the same physical state
with a different monitor memory can produce a different plan.

Supply state_features(state) to use iterative-width novelty pruning,
repeating breadth-first passes with widths 1 through max_width.
Novelty is tracked separately for each vector of monitor memories.
Without state_features, a single exact product-state pass is used.
Goal plans are shortest within the pass that discovered them.

:param start: Initial simulator state.
:param actions: Callable (state) generating legal or attempted actions in stable order.
:param simulate: Pure callable (state, action) returning successor or None.
:param goal: Callable returning whether the state completes the task.
:param labels: Callable returning the true atomic propositions for a state.
:param monitors: Ordered mapping from feature names to TemporalMonitor objects.
:param max_plans: Stop after finding this many distinct profiles.
:param budget: Maximum simulator calls across all passes. Zero permits the initial goal check.
:param max_depth: Optional maximum action sequence length.
:param state_features: Optional callable returning hashable novelty atoms.
:param max_width: Maximum novelty tuple size when state_features is supplied.

Definition at line 108 of file temporal_planning.py.

◆ ordered_visit()

qdpy.algorithms.temporal_planning.ordered_visit ( first,
second )

Require the second proposition to hold strictly after the first.

Accept a trace with a first visit followed at a later state by a second visit.

Definition at line 56 of file temporal_planning.py.