concepts.dm.pdsketch.strips.strips_grounding.GStripsTranslatorBase#
- class GStripsTranslatorBase[source]#
Bases:
object
Methods
compile_derived_predicate
(dp, state[, ...])compile_expr
(expr, state)compile_operator
(op, state[, is_relaxed])compile_regression_rule
(op, state)compile_state
(state[, forward_derived])compile_task
(state, goal_expr[, actions, ...])Compile a grounded STRIPS task.
define_grounded_predicate
(name[, modifier])Allocate a new identifier for the predicate (with modifier).
get_grounded_predicate_indentifier
(name[, ...])recompile_relaxed_task
(task[, ...])Recompile a task to a delete-relaxed task.
recompile_task_new_state
(task, new_state[, ...])Compile a new GStripsTask from a new state.
relevance_analysis
(task[, ...])Attributes
The domain.
The executor for the domain.
The mapping from predicate names to index.
- __init__(executor, use_string_name=True, prob_goal_threshold=0.5, use_derived_predicates=False, use_regression_rules=True)[source]#
- Parameters:
executor (PDSketchExecutor)
use_string_name (bool)
prob_goal_threshold (float)
use_derived_predicates (bool)
use_regression_rules (bool)
- __new__(**kwargs)#
- compile_expr(expr, state)[source]#
- Parameters:
expr (str | Expression)
state (State)
- Return type:
- compile_operator(op, state, is_relaxed=False)[source]#
- Parameters:
op (OperatorApplier)
state (State)
- Return type:
- compile_task(state, goal_expr, actions=None, regression_rules=None, is_relaxed=False, forward_relevance_analysis=True, backward_relevance_analysis=True, verbose=False)[source]#
Compile a grounded STRIPS task.
- Parameters:
state (State) – the initial state.
goal_expr (str | Expression) – the goal expression.
actions (Sequence[OperatorApplier] | None) – the list of actions. If not specified, all actions in the domain will be used.
regression_rules (Sequence[RegressionRuleApplier] | None) – the list of regression rules. If not specified, all regression rules in the domain will be used.
is_relaxed (bool) – whether the task is a delete-relaxed task.
forward_relevance_analysis (bool) – whether to perform forward relevance analysis.
backward_relevance_analysis (bool) – whether to perform backward relevance analysis.
verbose (bool) – whether to print verbose information.
- Returns:
the compiled task.
- Return type:
- define_grounded_predicate(name, modifier=None)[source]#
Allocate a new identifier for the predicate (with modifier).
- recompile_relaxed_task(task, forward_relevance_analysis=True, backward_relevance_analysis=True)[source]#
Recompile a task to a delete-relaxed task.
- Parameters:
task (GStripsProblem) – the task to be recompiled.
forward_relevance_analysis (bool) – whether to perform forward relevance analysis.
backward_relevance_analysis (bool) – whether to perform backward relevance analysis.
- Returns:
the recompiled task.
- Return type:
- recompile_task_new_state(task, new_state, forward_relevance_analysis=True, backward_relevance_analysis=True, forward_derived=False)[source]#
Compile a new GStripsTask from a new state.
- Parameters:
task (GStripsProblem) – the original task.
forward_relevance_analysis (bool) – whether to perform forward relevance analysis. Defaults to True.
backward_relevance_analysis (bool) – whether to perform backward relevance analysis. Defaults to True.
forward_derived (bool) – whether to forward derived predicates. Defaults to False.
- Returns:
the new task.
- Return type:
- relevance_analysis(task, relaxed_relevance=False, forward=True, backward=True)[source]#
- Parameters:
task (GStripsProblem)
relaxed_relevance (bool)
forward (bool)
backward (bool)
- Return type:
- property executor: PDSketchExecutor#
The executor for the domain.