1

私はpddlが初めてです。ロボットがさまざまなオブジェクトをさまざまな宛先セルに配置できるソリューションを見つける必要があります。http://www.fast-downward.org/のソフトウェアを使用しています。ただし、問題は、私の行動が必要な解決策を見つけられないことです。制限は、ロボットが物体を運んでいても、2 つの物体を同じ部屋に置くことはできないということです。添付: ドメイン ファイル:

(define (domain gripper-strips)
(:predicates (ROOM ?x) ;iff x is a room
    (OBJECT ?x) ;iff x is an onject
    (HAND ?x) ;iff x is the robot's hand
    (FREE ?x) ;iff x is the robot's hand and it is free of object
    (ROBOT-AT ?x) ;iff x is a room and robot is located in x
    (OBJECT-AT ?x ?y) ;iff x is an object + y is a room and x is located at y
    (PATH ?x ?y) ;iff x and y are both room and there is no wall in-between
    (CARRY ?x) ;iff x is an object and robot is carrying it
)


  (:action MoveWithoutObject
   :parameters  (?room1 ?room2 ?hand)
   :precondition (and  (ROOM ?room1) (ROOM ?room1) (HAND ?hand) (not(=?room1 ?room2))
           (FREE ?hand) (ROBOT-AT ?room1) (PATH ?room1 ?room2))
   :effect (and  (ROBOT-AT ?room2)
         (not (ROBOT-AT ?room1)))
)

 (:action MoveWithObject
   :parameters  (?room1 ?room2 ?obj ?hand)
   :precondition (and  (ROOM ?room1) (ROOM ?room2) (OBJECT ?obj) (HAND ?hand) (not(=?room1 ?room2))
           (not (OBJECT-AT ?obj ?room1)) (not (OBJECT-AT ?obj ?room2))
           (ROBOT-AT ?room1) (not(FREE ?hand))
           (PATH ?room1 ?room2))
   :effect (and  (ROBOT-AT ?room2)
         (not (ROBOT-AT ?room1)))
)

 (:action Pickup
   :parameters (?obj ?room ?hand)
   :precondition  (and  (OBJECT ?obj) (ROOM ?room) (HAND ?hand)
            (OBJECT-AT ?obj ?room) (ROBOT-AT ?room) (FREE ?hand) (not(CARRY ?obj)))
   :effect (and (CARRY ?obj) (not (OBJECT-AT ?obj ?room)) (not (FREE ?hand)))
)

 (:action Release
   :parameters  (?obj ?room ?hand)
   :precondition  (and (OBJECT ?obj) (ROOM ?room) (HAND ?hand)
            (not(OBJECT-AT ?obj ?room)) (ROBOT-AT ?room) (not(FREE ?hand)) (CARRY ?obj))
   :effect (and (OBJECT-AT ?obj ?room)
        (not(CARRY ?obj))
        (FREE ?hand))))

および問題のファイル:

(define (problem strips-gripper-x-8)
(:domain gripper-strips)
(:objects room1 room2 room3 room4 room5 room6 room7 room8 room9
     object1 object2 object3
         hand)

  (:init (ROOM room1)(ROOM room2)(ROOM room3)(ROOM room4)(ROOM room5)(ROOM room6)(ROOM room7)(ROOM room8)(ROOM room9)
  (OBJECT object1)(OBJECT objec21)(OBJECT object3)
  (HAND hand)
  (FREE hand)
  (ROBOT-AT room1)
  (OBJECT-AT object1 room6)(OBJECT-AT object2 room4)(OBJECT-AT object3 room7)
  (PATH room1 room4)(PATH room4 room1)
  (PATH room4 room5)(PATH room5 room4)
  (PATH room5 room6)(PATH room6 room5)
  (PATH room5 room8)(PATH room8 room5)
  (PATH room6 room9)(PATH room9 room6)
  (PATH room6 room3)(PATH room3 room6)
  (PATH room3 room2)(PATH room2 room3)
  (PATH room8 room7)(PATH room7 room8))

  (:goal (and (OBJECT-AT object1 room7)(OBJECT-AT object2 room2)(OBJECT-AT object3 room9))))
4

1 に答える 1

0

あなたのアプローチは一見正しいように見えますが、ファイルにいくつかのタイプミスがあり、解決策を見つける可能性を妨げています。

  1. 問題.pddl:

    変化する

    (OBJECT object1)(OBJECT objec21)(OBJECT object3)
    

    (OBJECT object1) (OBJECT object2) (OBJECT object3)
    
  2. domain.pddl:変更

    変化する

    (ROOM ?room1) (ROOM ?room1)
    

    実際の MoveWithObject

    (ROOM ?room1) (ROOM ?room2)
    

編集:

  1. そもそも言語を知らなかったので、これは最初のチェックを逃れ、変数には普遍的な数量化があると仮定しました。次のようにMoveWithObjectを修正する必要あります。

    (:action MoveWithObject
     :parameters  (?room1 ?room2 ?obj1 ?obj2 ?obj3 ?hand)
     :precondition (and  (ROOM ?room1) (ROOM ?room2) (HAND ?hand) (not(=?room1 ?room2))
       (OBJECT ?obj1) (OBJECT ?obj2) (OBJECT ?obj3) 
       (not (OBJECT-AT ?obj1 ?room1)) (not (OBJECT-AT ?obj1 ?room2))
       (not (OBJECT-AT ?obj2 ?room1)) (not (OBJECT-AT ?obj2 ?room2))
       (not (OBJECT-AT ?obj3 ?room1)) (not (OBJECT-AT ?obj3 ?room2))
       (not (= ?obj1 ?obj2))
       (not (= ?obj1 ?obj3))
       (not (= ?obj2 ?obj3))
       (ROBOT-AT ?room1) (not (FREE ?hand)) (PATH ?room1 ?room2))
       :effect (and  (ROBOT-AT ?room2)
             (not (ROBOT-AT ?room1)))
    )
    

これで、ソルバーは次の解を見つけます。

    Solution found!
    Actual search time: 2.23336s [t=4.41504s]
    movewithoutobject room1 room4 hand (1)
    movewithoutobject room4 room5 hand (1)
    movewithoutobject room5 room6 hand (1)
    pickup object1 room6 hand (1)
    movewithobject room6 room3 object1 object2 object3 hand (1)
    release object1 room3 hand (1)
    movewithoutobject room3 room6 hand (1)
    movewithoutobject room6 room5 hand (1)
    movewithoutobject room5 room8 hand (1)
    movewithoutobject room8 room7 hand (1)
    pickup object3 room7 hand (1)
    movewithobject room7 room8 object1 object2 object3 hand (1)
    movewithobject room8 room5 object1 object2 object3 hand (1)
    movewithobject room5 room6 object1 object2 object3 hand (1)
    movewithobject room6 room9 object1 object2 object3 hand (1)
    release object3 room9 hand (1)
    movewithoutobject room9 room6 hand (1)
    movewithoutobject room6 room3 hand (1)
    pickup object1 room3 hand (1)
    movewithobject room3 room6 object1 object2 object3 hand (1)
    movewithobject room6 room5 object1 object2 object3 hand (1)
    movewithobject room5 room8 object1 object2 object3 hand (1)
    movewithobject room8 room7 object1 object2 object3 hand (1)
    release object1 room7 hand (1)
    movewithoutobject room7 room8 hand (1)
    movewithoutobject room8 room5 hand (1)
    movewithoutobject room5 room4 hand (1)
    pickup object2 room4 hand (1)
    movewithobject room4 room5 object1 object2 object3 hand (1)
    movewithobject room5 room6 object1 object2 object3 hand (1)
    movewithobject room6 room3 object1 object2 object3 hand (1)
    movewithobject room3 room2 object1 object2 object3 hand (1)
    release object2 room2 hand (1)
    Plan length: 33 step(s).
    Plan cost: 33

このソリューションを見つけるために次の戦略を使用しましたが、他の戦略はより長いパスを見つける可能性があります。

 $ fast-downward.py --alias seq-opt-bjolp problem.pddl
于 2016-04-23T07:28:52.817 に答える