concepts.dm.pdsketch.strips.strips_grounding.GStripsOperator#
- class GStripsOperator[source]#
Bases:
object
A grounded STRIPS operator, the STRIPS version of the OperatorApplier. By grounded we mean that all the preconditions / effects are propositions.
Methods
applicable
(state)Return whether the operator is applicable to the state.
apply
(state)Apply the operator to the state.
compile
()Generate the compiled version of the operator (preconditions and effects).
filter_propositions
(propositions[, state])Filter the propositions in this expression.
Iterate over all the propositions used in the operator, including both preconditions and effects.
Attributes
The precondition for the operator.
The effects for the operator.
Implicit preconditions.
The raw operator.
An compiled version of the precondition tester.
A list of compiled version of the effect appliers.
- __init__(precondition, effects, raw_operator, implicit_propositions=None)[source]#
- Parameters:
precondition (GSBoolOutputExpression)
effects (Sequence[GSVariableAssignmentExpression])
raw_operator (OperatorApplier)
- __new__(**kwargs)#
- applicable(state)[source]#
Return whether the operator is applicable to the state.
- Parameters:
- Returns:
True if the operator is applicable, False otherwise. When the FORWARD_DIFF mode is enabled for
GSBoolExpression
, this function will return aGSBoolForwardDiffReturn
object.- Return type:
- apply(state)[source]#
Apply the operator to the state. Note that this function does not check the precondition. To do that, use
applicable()
before calling this function.
- filter_propositions(propositions, state=None)[source]#
Filter the propositions in this expression. Only the propositions in the given set will be kept. Note that this function also takes a state as input, essentially, the state is the initial state of the environment, and the propositions contains all propositions that will be possibly changed by actions. See
filter_propositions()
for more details.- Parameters:
- Returns:
a new operator with filtered propositions.
- Return type:
- iter_propositions()[source]#
Iterate over all the propositions used in the operator, including both preconditions and effects.
- effects: Tuple[GSVariableAssignmentExpression, ...]#
The effects for the operator.
- effects_func: Tuple[Callable[[SState], SState], ...] | None#
A list of compiled version of the effect appliers.
- precondition: GSBoolOutputExpression#
The precondition for the operator.
- raw_operator: OperatorApplier#
The raw operator. Note that since the strips operator is grounded, the raw operator is the
concepts.dm.pdsketch.operator.OperatorApplier
instance.