Skip to content

Commit

Permalink
Update pour option init to allow oracle to run when exclude all predi…
Browse files Browse the repository at this point in the history
…cates (#1682)

* Update pour option init

* fix yapf

---------

Co-authored-by: yichao-liang <yichao-liang>
  • Loading branch information
yichao-liang authored Jul 1, 2024
1 parent 079ed6d commit a3b862b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ machines.txt
tests/_fake_trajs
tests/_fake_results
sas_plan
downward/
Gymnasium-Robotics/

# Jetbrains IDEs
.idea/
8 changes: 7 additions & 1 deletion predicators/ground_truth_models/coffee/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@ def _TurnMachineOn_terminal(state: State, memory: Dict,
)

# Pour
def _Pour_initiable(state: State, memory: Dict,
objects: Sequence[Object], params: Array) -> bool:
del memory, params
robot, jug, _ = objects
return Holding.holds(state, [robot, jug])

def _Pour_terminal(state: State, memory: Dict,
objects: Sequence[Object], params: Array) -> bool:
del memory, params # unused
Expand All @@ -142,7 +148,7 @@ def _Pour_terminal(state: State, memory: Dict,
types=[robot_type, jug_type, cup_type],
params_space=Box(0, 1, (0, )),
policy=cls._create_pour_policy(),
initiable=lambda s, m, o, p: True,
initiable=_Pour_initiable,
terminal=_Pour_terminal,
)

Expand Down

0 comments on commit a3b862b

Please sign in to comment.