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

Weighted script portfolios with progressive unpruning and MAP-Elites. More...

Go to the source code of this file.

Classes

class  qdpy.algorithms.portfolio_mcts.PortfolioMCTSResult
 A measured path and the planner's simulation and branching counts. More...
class  qdpy.algorithms.portfolio_mcts.PortfolioQDResult
 A planner repertoire with separately counted outer and inner work. More...
class  qdpy.algorithms.portfolio_mcts._Node
class  qdpy.algorithms.portfolio_mcts._Edge
class  qdpy.algorithms.portfolio_mcts._Planner

Namespaces

namespace  qdpy

Functions

 qdpy.algorithms.portfolio_mcts.portfolio_mcts (start, *, scripts, weights, simulate, budget, horizon, simulations=None, initial_fraction=.5, unprune_at=4, unprune_rate=2., exploration=1.414, progressive_bias=1., discount=1., seed=0)
 Plan with weighted scripts and a visit-dependent expansion limit.
 qdpy.algorithms.portfolio_mcts.portfolio_map_elites (archive, scenarios, *, scripts, simulate, summarize, budget, plan_budget, horizon, random_initial=8, planner_options=None, seed=0)
 Run the outer MAP-Elites search over script weights.

Detailed Description

Weighted script portfolios with progressive unpruning and MAP-Elites.

See also
https://doi.org/10.1109/CoG52621.2021.9619094

Definition in file portfolio_mcts.py.

Function Documentation

◆ portfolio_map_elites()

qdpy.algorithms.portfolio_mcts.portfolio_map_elites ( archive,
scenarios,
* ,
scripts,
simulate,
summarize,
budget,
plan_budget,
horizon,
random_initial = 8,
planner_options = None,
seed = 0 )

Run the outer MAP-Elites search over script weights.

Parameters
archiveEmpty scalar Grid or CVTGrid for planner strategies.
scenariosOrdered panel of initial simulator states.
scriptsOrdered action-ranking callbacks.
simulateDeterministic transition callback used by every planner.
summarizeCallable (plans) returning ((fitness,), descriptors).
budgetNumber of weight vectors to evaluate.
plan_budgetMaximum simulator calls per candidate and scenario.
horizonMaximum path length in each plan.
random_initialNumber of random samples after single-script seeds.
planner_optionsOptional keyword options for portfolio_mcts.
seedPrivate outer search and scenario seed.
Returns
PortfolioQDResult with the archive and counts.
Seed with one active script at a time and then mutate one weight per proposal.

Definition at line 213 of file portfolio_mcts.py.

◆ portfolio_mcts()

qdpy.algorithms.portfolio_mcts.portfolio_mcts ( start,
* ,
scripts,
weights,
simulate,
budget,
horizon,
simulations = None,
initial_fraction = .5,
unprune_at = 4,
unprune_rate = 2.,
exploration = 1.414,
progressive_bias = 1.,
discount = 1.,
seed = 0 )

Plan with weighted scripts and a visit-dependent expansion limit.

Parameters
startInitial simulator state.
scriptsOrdered callables (state) yielding legal (action, score) pairs.
weightsNonnegative script weights in [0, 1].
simulatePure callable (state, action) returning (successor, reward, terminated).
budgetHard cap on simulator transitions.
horizonMaximum simulated actions in each path.
simulationsMaximum tree simulations, default equal to budget.
initial_fractionFraction of ranked actions eligible at the start.
unprune_atVisits before the first extra action becomes eligible.
unprune_rateExponential growth in intervals between newly eligible actions.
explorationUCB exploration coefficient.
progressive_biasCoefficient of the decaying script heuristic.
discountReturn discount in (0, 1].
seedPrivate seed for weighted rollouts.
Returns
Best measured path and budget statistics.
Rank duplicate suggestions by their strongest weighted score.

At each node, start with the most preferred fraction of actions and
gradually expose the rest as visits accumulate. Score visited actions
by UCB with a decaying script bias. Cache deterministic tree edges,
and charge every actual simulator call, including rollouts.

Definition at line 170 of file portfolio_mcts.py.