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

Find bounded-cost plan pools and select diverse subsets. More...

Go to the source code of this file.

Classes

class  qdpy.algorithms.forbid_planning.CostedPlan
 A complete goal-reaching plan with its measured cost and final state. More...
class  qdpy.algorithms.forbid_planning.ForbidPlanningResult
 Keep the candidate pool, selected subset, and the cost of both stages. More...

Namespaces

namespace  qdpy

Functions

 qdpy.algorithms.forbid_planning.action_multiset_distance (left, right)
 Compute one minus weighted Jaccard similarity of the action multisets.
 qdpy.algorithms.forbid_planning.forbid_iterative_planning (start, *, actions, simulate, goal, size, max_depth, budget, pool_size=64, cost_ceiling=np.inf, distinct="multiset", selection="diverse", diversity="mean", distance=action_multiset_distance, distance_floor=None)
 Collect cost-ordered distinct plans and choose a bounded diverse subset.

Detailed Description

Find bounded-cost plan pools and select diverse subsets.

See also
https://doi.org/10.1609/AAAI.V34I06.6543

Definition in file forbid_planning.py.

Function Documentation

◆ action_multiset_distance()

qdpy.algorithms.forbid_planning.action_multiset_distance ( left,
right )

Compute one minus weighted Jaccard similarity of the action multisets.

Parameters
leftFirst CostedPlan.
rightSecond CostedPlan.
Returns
A dissimilarity in [0, 1], zero for two empty plans.
Count repeated actions and ignore their ordering.

Definition at line 60 of file forbid_planning.py.

◆ forbid_iterative_planning()

qdpy.algorithms.forbid_planning.forbid_iterative_planning ( start,
* ,
actions,
simulate,
goal,
size,
max_depth,
budget,
pool_size = 64,
cost_ceiling = np.inf,
distinct = "multiset",
selection = "diverse",
diversity = "mean",
distance = action_multiset_distance,
distance_floor = None )

Collect cost-ordered distinct plans and choose a bounded diverse subset.

Parameters
startInitial simulator state.
actionsCallable (state) returning hashable action identifiers in stable order.
simulatePure callable (state, action) returning (successor, cost) or None for illegal moves.
goalPredicate on the state.
sizeDesired number of selected plans.
max_depthMaximum number of actions in a candidate plan.
budgetMaximum number of simulator calls, including illegal moves.
pool_sizeMaximum number of distinct candidate plans to collect.
cost_ceilingMaximum cost per plan.
distinctTreat reordered action multisets as equivalent, or use "sequence".
selectionGreedy diversity selection or cheapest-plan control ("cost").
diversityGreedy aggregation, "mean" or "minimum" pair distance.
distanceSymmetric nonnegative dissimilarity between completed CostedPlan values.
distance_floorIf supplied, find the cheapest size-plan clique with that pairwise floor.
Returns
Plan pool, deployment panel, and simulation and selection costs.
Adapt the forbid-and-select method to a bounded deterministic simulator.

A shared uniform-cost frontier enumerates goal plans and forbids
duplicate sequences or action multisets during collection. Plans may
visit the same state via different prefixes. Expansion ends at the
first goal of a path. Select a diverse subset from that pool by
growing the most distant pair, or solve the paper's clique formulation
to enforce a minimum pairwise separation.

Definition at line 172 of file forbid_planning.py.