0

I am struggling with defining the effect of an action. The scenario is the following: I have two balls (a and b). Each of them can be taken and put. As soon as one of the balls is put, one of the lamps L1, L2, L3 goes on (it does not matter which one) I have defined a, b - ball, L1, L2, L3 - lamp and I have an action with the following definition:

(:action put 
 :parameters (?b - ball)
 :precondition
   (and
     (ballTaken ?b)
   )
 :effect
   (and
    (not( ballTaken ?b))
    (... **one of the lamps goes on**...)
   )
)

How can I express this "one of the lamps goes on" in pddl? So, basically - how can I use objects which are not given as parameters to the action in the effect ? Thank you!

teoML
  • 784
  • 4
  • 13

1 Answers1

2

That's a non-deterministic effect...is that what you wanted? If it's arbitrary and you don't care which, then use a parameter for the lamp. If you want one of them to randomly be selected, then use non-deterministic planning notation...

(oneof (on lamp1) (on lamp2) (on lamp3))
haz
  • 625
  • 4
  • 12
  • oh, I didn't know that oneof exists. But yeah, I wanted to have a non-deterministic effect. Is there a way to achieve the same without using constants? In your example lamp1 lamp2 lamp3 are constants. Is there something like "oneof (on l -lamp)"? – teoML May 03 '22 at 20:48
  • 1
    It's a really good question -- no, I don't think any of the non-deterministic planners out there would support quantified non-determinism like this. Wouldn't be super hard to implement, but just hasn't come up in the field. – haz May 04 '22 at 21:43