concepts.dm.pdsketch.strips.strips_grounded_expression.GSConditionalAssignExpression#
- class GSConditionalAssignExpression[source]#
Bases:
GSVariableAssignmentExpression
A conditional assignment expression. Note that the inner expression must be a simple assignment expression. Therefore , a conditional assignment expression is represented by a condition, a set of add effects, and a set of delete effects.
Methods
applicable
(state)Check if the conditional assignment expression is applicable in the given state.
apply
(state)Apply the conditional assignment expression in the given state.
compile
()Compile the assignment expression into a function.
filter_propositions
(propositions[, state])Filter the given propositions from the expression.
Iterate over all propositions that are used in this expression.
relax
()Delete relaxation of a conditional assignment.
Attributes
The add effects of the conditional assignment expression.
The delete effects of the conditional assignment expression.
The condition of the conditional assignment expression.
The inner (simple) assignment expression of the conditional assignment expression.
The compiled condition function.
The compiled assignment function.
- __init__(condition, assignment)[source]#
Initialize the conditional assignment expression.
- Parameters:
condition (GSBoolOutputExpression) – the condition.
assignment (GSSimpleBoolAssignExpression) – the simple assignment expression.
- __new__(**kwargs)#
- applicable(state)[source]#
Check if the conditional assignment expression is applicable in the given state.
- Parameters:
state (SState)
- Return type:
- compile()[source]#
Compile the assignment expression into a function. By default, the function will return the state with the add and delete effects applied.
- filter_propositions(propositions, state=None)[source]#
Filter the given propositions from the expression. For conditional assignment expressions, the filtering is done by filtering the inner simple assignment expression and the condition.
- Parameters:
- Returns:
the conditional assignment expression after filtering.
- Return type:
- relax()[source]#
Delete relaxation of a conditional assignment. Essentially, it removes all delete effects for the inner simple assignment expression.
- Returns:
the delete relaxed conditional assignment expression.
- Return type:
- assignment: GSSimpleBoolAssignExpression#
The inner (simple) assignment expression of the conditional assignment expression.
- condition: GSBoolOutputExpression#
The condition of the conditional assignment expression.