up_SMT_engine.actions.R2ExistsAction¶
Classes
|
Extension of BaseAction to support relaxed relaxed ThereExists parallelism, allowing actions to be enabled, and change other action effects within a timestep |
- class up_SMT_engine.actions.R2ExistsAction.R2ExistsAction(grounded_action)[source]¶
Bases:
BaseAction
Extension of BaseAction to support relaxed relaxed ThereExists parallelism, allowing actions to be enabled, and change other action effects within a timestep
- __get_effects_at_t(timestep, r2exists_tuple)¶
Each effect has three FNODE structures, the condition (optional, makes effect conditional), fluent (the stated variable to be changed) and the value (the new fluent value). These are separately converted into Z3, and returned as Implies(condition, (fluent == value)) These statements are And’d together, as the set of effects of the action. n.b. The fluents in the ‘fluent’ part of the effect are in the next state (timestep + 1), because they are the result of the current action, while all other fluents are in the current state
- Args:
timestep (int): current timestep r2exists_tuple (Tuple, optional): Tuple used to convey information needed for handling chained variables. Defaults to None.
- Returns:
List(z3 expression): List of expressions for action effects
- __get_causal_axioms_at_t(timestep, r2exists_tuple)¶
The causal axioms assert the effects, given the action occurs
- Args:
timestep (int): Current timestep r2exists_tuple (Tuple, optional): Tuple used to convey information needed for handling chained variables. Defaults to None.
- Returns:
z3 expression: A z3 expression representing the causal axioms of this action at timestep t
- get_causal_axioms_up_to_t(timestep, fluents_list, actions_list)[source]¶
Generate the list of causal axioms for a problem of length up to timestep t
- Args:
timestep (int): Final timestep fluents_list (List(BaseFluent or BaseFluent subclass)): List of fluents actions_list (List(BaseAction or BaseAction subclass)): List of actions
- Returns:
List(z3 expression): A list of z3 expressions representing the causal axioms of this action up to timestep t
- get_causal_axioms_at_t(timestep, fluents_list, actions_list)[source]¶
Get causal axioms for a timestep
- Args:
timestep (int): a timestep fluents_list (List(BaseFluent or BaseFluent subclass)): List of fluents actions_list (List(BaseAction or BaseAction subclass)): List of actions
- Returns:
z3 expression: A z3 expression representing the causal axioms of this action at timestep t
- __get_precondition_constraints_at_t(timestep, r2exists_tuple)¶
Generate the precondition constraints for this action at timestep t Precondition constraint is: action occuring at timestep t implies preconditions are true at timestep t
- Args:
timestep (int): Current timestep r2exists_tuple (Tuple, optional): Tuple used to convey information needed for handling chained variables. Defaults to None.
- Returns:
z3 expression: A z3 expression representing the precondition constraints for this action at timestep t
- get_precondition_constraints_up_to_t(timestep, fluents_list, actions_list)[source]¶
Generate the list of precondition constraints for a problem of length up to timestep t
- Args:
timestep (int): Final timestep fluents_list (List(BaseFluent or BaseFluent subclass)): List of fluents actions_list (List(BaseAction or BaseAction subclass)): List of actions
- Returns:
List(z3 expression): A list of z3 expressions representing the precondition constraints of this action up to timestep t
- get_precondition_constraints_at_t(timestep, fluents_list, actions_list)[source]¶
Get precondition constraints for a timestep
- Args:
timestep (int): a timestep fluents_list (List(BaseFluent or BaseFluent subclass)): List of fluents actions_list (List(BaseAction or BaseAction subclass)): List of actions
- Returns:
z3 expression: A z3 expression representing the precondition constraints of this action at timestep t