0

域.pdfl

  (define (domain tour)
  (:requirements :negative-preconditions :equality :strips :adl :fluents :action-costs)

  (:predicates
    (at ?a ?bin)
    (free ?bin)
    (connected ?x ?y)
   )
   
   (:types 
   location 
   agent)
  
  (:functions (total-cost) - number
  (cost ?l1 ?l2 - location) - number
  )


  (:action move
   :parameters (?a - agent ?orgin ?dest - location)
   :precondition (and (at ?a ?orgin)
              (connected ?orgin ?dest)
              (free ?dest))
   :effect (and (not (at ?a ?orgin))
        (at ?a ?dest)

    
        (increase (total-cost) (cost ?orgin ?dest)))
   )

  

  )

问题.pdf

   (define (problem tour-problem)
  (:domain tour)


  (:objects b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 b17 b18 - location
    truck - agent) 

  (:init 
   
    (connected b1 b2)
    (connected b2 b1)
    (connected b1 b3)
    (connected b3 b1)
    (connected b1 b4)
    (connected b4 b1)
    (connected b1 b5)
    (connected b5 b1)
    (connected b1 b6)
    (connected b6 b1)
    (connected b1 b10)
    (connected b10 b1)
    (connected b1 b14)
    (connected b14 b1)
    (connected b1 b18)
    (connected b18 b1)
    (connected b2 b3)
    (connected b3 b2)
    (connected b2 b6)
    (connected b6 b2)
    (connected b2 b7)
    (connected b7 b2)
    (connected b3 b4)
    (connected b4 b3)
    (connected b3 b6)
    (connected b6 b3)
    (connected b3 b7)
    (connected b7 b3)
    (connected b3 b8)
    (connected b8 b3)
    (connected b4 b5)
    (connected b5 b4)
    (connected b4 b7)
    (connected b7 b4)
    (connected b4 b8)
    (connected b8 b4)
    (connected b4 b9)
    (connected b9 b4)
    (connected b5 b8)
    (connected b8 b5)
    (connected b5 b9)
    (connected b9 b5)
    (connected b5 b18)
    (connected b18 b5)
    (connected b6 b7)
    (connected b7 b6)
    (connected b6 b10)
    (connected b10 b6)
    (connected b6 b11)
    (connected b11 b6)
    (connected b7 b8)
    (connected b8 b7)
    (connected b7 b11)
    (connected b11 b7)
    (connected b8 b9)
    (connected b9 b8)
    (connected b8 b11)
    (connected b11 b8)
    (connected b8 b12)
    (connected b12 b8)
    (connected b8 b13)
    (connected b13 b8)
    (connected b9 b13)
    (connected b13 b9)
    (connected b9 b18)
    (connected b18 b9)
    (connected b10 b11)
    (connected b11 b10)
    (connected b10 b14)
    (connected b14 b10)
    (connected b10 b15)
    (connected b15 b10)
    (connected b11 b12)
    (connected b12 b11)
    (connected b11 b14)
    (connected b14 b11)
    (connected b11 b16)
    (connected b16 b11)
    (connected b12 b13)
    (connected b13 b12)
    (connected b12 b15)
    (connected b15 b12)
    (connected b12 b17)
    (connected b17 b12)
    (connected b13 b16)
    (connected b16 b13)
    (connected b13 b17)
    (connected b17 b13)
    (connected b13 b18)
    (connected b18 b13)
    (connected b14 b15)
    (connected b15 b14)
    (connected b14 b18)
    (connected b18 b14)
    (connected b15 b16)
    (connected b16 b15)
    (connected b15 b18)
    (connected b18 b15)
    (connected b16 b17)
    (connected b17 b16)
    (connected b16 b18)
    (connected b18 b16)
    (connected b17 b18)
    (connected b18 b17)
    
    
    
    
    (= (total-cost) 0)
    ; (= (cost b0 b1) 1)
    ; (= (cost b0 b1) 1)
    (= (cost b1 b2) 1)
    (= (cost b2 b1) 1)
    (= (cost b1 b3) 2)
    (= (cost b3 b1) 2)
    (= (cost b1 b4) 1)
    (= (cost b4 b1) 1)
    (= (cost b1 b5) 3)
    (= (cost b5 b1) 3)
    (= (cost b1 b6) 4)
    (= (cost b6 b1) 4)
    (= (cost b1 b10) 6)
    (= (cost b10 b1) 6)
    (= (cost b1 b14) 8)
    (= (cost b14 b1) 8)
    (= (cost b1 b18) 15)
    (= (cost b18 b1) 15)
    (= (cost b2 b3) 3)
    (= (cost b3 b2) 3)
    (= (cost b2 b6) 3)
    (= (cost b6 b2) 3)
    (= (cost b2 b7) 2)
    (= (cost b7 b2) 2)
    (= (cost b3 b4) 2)
    (= (cost b4 b3) 2)
    (= (cost b3 b6) 1)
    (= (cost b6 b3) 1)
    (= (cost b3 b7) 2)
    (= (cost b7 b3) 2)
    (= (cost b3 b8) 4)
    (= (cost b8 b3) 4)
    (= (cost b4 b5) 1)
    (= (cost b5 b4) 1)
    (= (cost b4 b7) 4)
    (= (cost b7 b4) 4)
    (= (cost b4 b8) 5)
    (= (cost b8 b4) 5)
    (= (cost b4 b9) 5)
    (= (cost b9 b4) 5)
    (= (cost b5 b8) 6)
    (= (cost b8 b5) 6)
    (= (cost b5 b9) 2)
    (= (cost b9 b5) 2)
    (= (cost b5 b18) 12)
    (= (cost b18 b5) 12)
    (= (cost b6 b7) 1)
    (= (cost b7 b6) 1)
    (= (cost b6 b10) 2)
    (= (cost b10 b6) 2)
    (= (cost b6 b11) 1)
    (= (cost b11 b6) 1)
    (= (cost b7 b8) 3)
    (= (cost b8 b7) 3)
    (= (cost b7 b11) 1)
    (= (cost b11 b7) 1)
    (= (cost b8 b9) 4)
    (= (cost b9 b8) 4)
    (= (cost b8 b11) 2)
    (= (cost b11 b8) 2)
    (= (cost b8 b12) 3)
    (= (cost b12 b8) 3)
    (= (cost b8 b13) 1)
    (= (cost b13 b8) 1)
    (= (cost b9 b13) 3)
    (= (cost b13 b9) 3)
    (= (cost b9 b18) 10)
    (= (cost b18 b9) 10)
    (= (cost b10 b11) 1)
    (= (cost b11 b10) 1)
    (= (cost b10 b14) 2)
    (= (cost b14 b10) 2)
    (= (cost b10 b15) 4)
    (= (cost b15 b10) 4)
    (= (cost b11 b12) 1)
    (= (cost b12 b11) 1)
    (= (cost b11 b14) 5)
    (= (cost b14 b11) 5)
    (= (cost b11 b16) 1)
    (= (cost b16 b11) 1)
    (= (cost b12 b13) 2)
    (= (cost b13 b12) 2)
    (= (cost b12 b15) 1)
    (= (cost b15 b12) 1)
    (= (cost b12 b17) 3)
    (= (cost b17 b12) 3)
    (= (cost b13 b16) 2)
    (= (cost b16 b13) 2)
    (= (cost b13 b17) 2)
    (= (cost b17 b13) 2)
    (= (cost b13 b18) 7)
    (= (cost b18 b13) 7)
    (= (cost b14 b15) 2)
    (= (cost b15 b14) 2)
    (= (cost b14 b18) 1)
    (= (cost b18 b14) 1)
    (= (cost b15 b16) 1)
    (= (cost b16 b15) 1)
    (= (cost b15 b18) 1)
    (= (cost b18 b15) 1)
    (= (cost b16 b17) 2)
    (= (cost b17 b16) 2)
    (= (cost b16 b18) 1)
    (= (cost b18 b16) 1)
    (= (cost b17 b18) 5)
    (= (cost b18 b17) 5)

    
    
  )
          
  (:goal (and 
         (at truck b1)
         (free b1)
          
          
       )
  )
  (:metric minimize(total-cost))
)
4

0 回答 0