1

我是新来的PDDL。我使用在线编辑器。我有这个问题:有 3 名特工、3 名食人者和一艘最多可容纳 2 人的船。它们之间还有两个海岸和一条河流。所有的人最初都在一个海岸上。岸上的食人者不会比特工多,我需要找到一种方法将他们全部转移到彼岸。当我试图解决它时,我得到了这个错误:

"Suspected timeout. arity of VALID_STATE to high! increase MAX_ARITY (currently 5)"

如果有人能找到我做错了什么,或者至少告诉我更多关于这个错误以及如何解决它,我将非常感激。这是问题

(define (problem traversare)
    (:domain problema1)
    (:objects stg dr)
    (:init 
        (current_position stg stg stg stg stg stg)
        
        (valid_state stg stg stg stg stg stg)
        (valid_state dr dr dr stg stg stg)
        
        (valid_state stg stg stg dr dr stg)
        (valid_state dr dr stg dr dr stg)
        (valid_state dr stg dr dr dr stg)
        (valid_state stg dr dr dr dr stg)
        (valid_state dr dr dr dr dr stg)
        
        (valid_state stg stg stg dr stg dr)
        (valid_state dr dr stg dr stg dr)
        (valid_state dr stg dr dr stg dr)
        (valid_state stg dr dr dr stg dr)
        (valid_state dr dr dr dr stg dr)
        
        (valid_state stg stg stg stg dr dr)
        (valid_state dr dr stg stg dr dr)
        (valid_state dr stg dr stg dr dr)
        (valid_state stg dr dr stg dr dr)
        (valid_state dr dr dr stg dr dr)
        
        
        (valid_state stg stg stg stg stg dr)
        (valid_state dr stg stg stg stg dr)
        (valid_state stg dr stg stg stg dr)
        (valid_state stg stg dr stg stg dr)
        (valid_state dr dr dr stg stg dr)
        
        
        (valid_state stg stg stg stg dr stg)
        (valid_state dr stg stg stg dr stg)
        (valid_state stg dr stg stg dr stg)
        (valid_state stg stg dr stg dr stg)
        (valid_state dr dr dr stg dr stg)
        
        
        (valid_state stg stg stg dr stg stg)
        (valid_state dr stg stg dr stg stg)
        (valid_state stg dr stg dr stg stg)
        (valid_state stg stg dr dr stg stg)
        (valid_state dr dr dr dr stg stg)
        
        (valid_state dr dr dr dr dr dr)

    )
    (:goal 
        (current_position dr dr dr dr dr dr))


)

在这里,我已经根据练习的要求写下了所有可能的状态。

这是

(define (domain problema1)
    (:predicates
        (current_position ?m1 ?m2 ?m3 ?c1 ?c2 ?c3)
        (valid_state ?m1 ?m2 ?m3 ?c1 ?c2 ?c3)
    )
    (:action moveM1SD
        :parameters (?m2 ?m3 ?c1 ?c2 ?c3)
        :precondition   (and    (current_position stg ?m2 ?m3 ?c1 ?c2 ?c3)
                                (valid_state dr ?m2 ?m3 ?c1 ?c2 ?c3)
                        )
        :effect (and (current_position dr ?m2 ?m3 ?c1 ?c2 ?c3)
                (not (current_position stg ?m2 ?m3 ?c1 ?c2 ?c3)))
    )
    (:action moveM2SD
        :parameters (?m1 ?m3 ?c1 ?c2 ?c3)
        :precondition   (and    (current_position ?m1 stg ?m3 ?c1 ?c2 ?c3)
                                (valid_state ?m1 dr ?m3 ?c1 ?c2 ?c3)
                        )
        :effect (and (current_position ?m1 dr ?m3 ?c1 ?c2 ?c3)
                (not (current_position ?m1 stg ?m3 ?c1 ?c2 ?c3)))
    )
    (:action moveM3SD
        :parameters (?m1 ?m2 ?c1 ?c2 ?c3)
        :precondition   (and    (current_position ?m1 ?m2 stg ?c1 ?c2 ?c3)
                                (valid_state ?m1 ?m2 dr ?c1 ?c2 ?c3)
                        )
        :effect (and (current_position ?m1 ?m2 dr ?c1 ?c2 ?c3)
                (not (current_position ?m1 ?m2 stg ?c1 ?c2 ?c3)))
    )
    (:action moveC1SD
        :parameters (?m1 ?m2 ?m3 ?c2 ?c3)
        :precondition   (and    (current_position ?m1 ?m2 ?m3 stg ?c2 ?c3)
                                (valid_state ?m1 ?m2 ?m3 dr ?c2 ?c3)
                        )
        :effect (and (current_position ?m1 ?m2 ?m3 dr ?c2 ?c3)
                (not (current_position ?m1 ?m2 ?m3 stg ?c2 ?c3)))
    )
    (:action moveC2SD
        :parameters (?m1 ?m2 ?m3 ?c1 ?c3)
        :precondition   (and    (current_position ?m1 ?m2 ?m3 ?c1 stg ?c3)
                                (valid_state ?m1 ?m2 ?m3 ?c1 dr ?c3)
                        )
        :effect (and (current_position ?m1 ?m2 ?m3 ?c1 dr ?c3)
                (not (current_position ?m1 ?m2 ?m3 ?c1 stg ?c3)))
    )
    (:action moveC3SD
        :parameters (?m1 ?m2 ?m3 ?c1 ?c2)
        :precondition   (and    (current_position ?m1 ?m2 ?m3 ?c1 ?c2 stg)
                                (valid_state ?m1 ?m2 ?m3 ?c1 ?c2 dr)
                        )
        :effect (and (current_position ?m1 ?m2 ?m3 ?c1 ?c2 dr)
                (not (current_position ?m1 ?m2 ?m3 ?c1 ?c2 stg)))
    )
    
    (:action moveM1DS
        :parameters (?m2 ?m3 ?c1 ?c2 ?c3)
        :precondition   (and    (current_position dr ?m2 ?m3 ?c1 ?c2 ?c3)
                                (valid_state stg ?m2 ?m3 ?c1 ?c2 ?c3)
                        )
        :effect (and (current_position stg ?m2 ?m3 ?c1 ?c2 ?c3)
                (not (current_position dr ?m2 ?m3 ?c1 ?c2 ?c3)))
    )
    (:action moveM2DS
        :parameters (?m1 ?m3 ?c1 ?c2 ?c3)
        :precondition   (and    (current_position ?m1 dr ?m3 ?c1 ?c2 ?c3)
                                (valid_state ?m1 stg ?m3 ?c1 ?c2 ?c3)
                        )
        :effect (and (current_position ?m1 stg ?m3 ?c1 ?c2 ?c3)
                (not (current_position ?m1 dr ?m3 ?c1 ?c2 ?c3)))
    )
    (:action moveM3DS
        :parameters (?m1 ?m2 ?c1 ?c2 ?c3)
        :precondition   (and    (current_position ?m1 ?m2 dr ?c1 ?c2 ?c3)
                                (valid_state ?m1 ?m2 stg ?c1 ?c2 ?c3)
                        )
        :effect (and (current_position ?m1 ?m2 stg ?c1 ?c2 ?c3)
                (not (current_position ?m1 ?m2 dr ?c1 ?c2 ?c3)))
    )
    (:action moveC1DS
        :parameters (?m1 ?m2 ?m3 ?c2 ?c3)
        :precondition   (and    (current_position ?m1 ?m2 ?m3 dr ?c2 ?c3)
                                (valid_state ?m1 ?m2 ?m3 stg ?c2 ?c3)
                        )
        :effect (and (current_position ?m1 ?m2 ?m3 stg ?c2 ?c3)
                (not (current_position ?m1 ?m2 ?m3 dr ?c2 ?c3)))
    )
    (:action moveC2DS
        :parameters (?m1 ?m2 ?m3 ?c1 ?c3)
        :precondition   (and    (current_position ?m1 ?m2 ?m3 ?c1 dr ?c3)
                                (valid_state ?m1 ?m2 ?m3 ?c1 stg ?c3)
                        )
        :effect (and (current_position ?m1 ?m2 ?m3 ?c1 stg ?c3)
                (not (current_position ?m1 ?m2 ?m3 ?c1 dr ?c3)))
    )
    (:action moveC3DS
        :parameters (?m1 ?m2 ?m3 ?c1 ?c2)
        :precondition   (and    (current_position ?m1 ?m2 ?m3 ?c1 ?c2 dr)
                                (valid_state ?m1 ?m2 ?m3 ?c1 ?c2 stg)
                        )
        :effect (and (current_position ?m1 ?m2 ?m3 ?c1 ?c2 stg)
                (not (current_position ?m1 ?m2 ?m3 ?c1 ?c2 dr)))
    )
    
    (:action moveM1M2SD
        :parameters (?m3 ?c1 ?c2 ?c3)
        :precondition (and  (current_position stg stg ?m3 ?c1 ?c2 ?c3)
                            (valid_state dr dr ?m3 ?c1 ?c2 ?c3))
        :effect (and (current_position dr dr ?m3 ?c1 ?c2 ?c3)
                (not (current_position stg stg ?m3 ?c1 ?c2 ?c3)))
    )
    (:action moveM1M3SD
        :parameters (?m2 ?c1 ?c2 ?c3)
        :precondition (and  (current_position stg ?m2 stg ?c1 ?c2 ?c3)
                            (valid_state dr ?m2 dr ?c1 ?c2 ?c3))
        :effect (and (current_position dr ?m2 dr ?c1 ?c2 ?c3)
                (not (current_position stg ?m2 stg ?c1 ?c2 ?c3)))
    )
    (:action moveM1C1SD
        :parameters (?m2 ?m3 ?c2 ?c3)
        :precondition (and  (current_position stg ?m2 ?m3 stg ?c2 ?c3)
                            (valid_state dr ?m2 ?m3 dr ?c2 ?c3))
        :effect (and (current_position dr ?m2 ?m3 dr ?c2 ?c3)
                (not (current_position stg ?m2 ?m3 stg ?c2 ?c3)))
    )
    (:action moveM1C2SD
        :parameters (?m2 ?m3 ?c1 ?c3)
        :precondition (and  (current_position stg ?m2 ?m3 ?c1 stg ?c3)
                            (valid_state dr ?m2 ?m3 ?c1 dr ?c3))
        :effect (and (current_position dr ?m2 ?m3 ?c1 dr ?c3)
                (not (current_position stg ?m2 ?m3 ?c1 stg ?c3)))
    )
    (:action moveM1C3SD
        :parameters (?m2 ?m3 ?c1 ?c2)
        :precondition (and  (current_position stg ?m2 ?m3 ?c1 ?c2 stg)
                            (valid_state dr ?m2 ?m3 ?c1 ?c2 dr))
        :effect (and (current_position dr ?m2 ?m3 ?c1 ?c2 dr)
                (not (current_position stg ?m2 ?m3 ?c1 ?c2 stg)))
    )
    (:action moveM2M3SD
        :parameters (?m1 ?c1 ?c2 ?c3)
        :precondition (and  (current_position ?m1 stg stg ?c1 ?c2 ?c3)
                            (valid_state ?m1 dr dr ?c1 ?c2 ?c3))
        :effect (and (current_position ?m1 dr dr ?c1 ?c2 ?c3)
                (not (current_position ?m1 stg stg ?c1 ?c2 ?c3)))
    )
    (:action moveM2C1SD
        :parameters (?m1 ?m3 ?c2 ?c3)
        :precondition (and  (current_position ?m1 stg ?m3 stg ?c2 ?c3)
                            (valid_state ?m1 dr ?m3 dr ?c2 ?c3))
        :effect (and (current_position ?m1 dr ?m3 dr ?c2 ?c3)
                (not (current_position ?m1 stg ?m3 stg ?c2 ?c3)))
    )
    (:action moveM2C2SD
        :parameters (?m1 ?m3 ?c1 ?c3)
        :precondition (and  (current_position ?m1 stg ?m3 ?c1 stg ?c3)
                            (valid_state ?m1 dr ?m3 ?c1 dr ?c3))
        :effect (and (current_position ?m1 dr ?m3 ?c1 dr ?c3)
                (not (current_position ?m1 stg ?m3 ?c1 stg ?c3)))
    )
    (:action moveM2C3SD
        :parameters (?m1 ?m3 ?c1 ?c2)
        :precondition (and  (current_position ?m1 stg ?m3 ?c1 ?c2 stg)
                            (valid_state ?m1 dr ?m3 ?c1 ?c2 dr))
        :effect (and (current_position ?m1 dr ?m3 ?c1 ?c2 dr)
                (not (current_position ?m1 stg ?m3 ?c1 ?c2 stg)))
    )
    (:action moveM3C1SD
        :parameters (?m1 ?m2 ?c2 ?c3)
        :precondition (and  (current_position ?m1 ?m2 stg stg ?c2 ?c3)
                            (valid_state ?m1 ?m2 dr dr ?c2 ?c3))
        :effect (and (current_position ?m1 ?m2 dr dr ?c2 ?c3)
                (not (current_position ?m1 ?m2 stg stg ?c2 ?c3)))
    )
    (:action moveM3C2SD
        :parameters (?m1 ?m2 ?c1 ?c3)
        :precondition (and  (current_position ?m1 ?m2 stg ?c1 stg ?c3)
                            (valid_state ?m1 ?m2 dr ?c1 dr ?c3))
        :effect (and (current_position ?m1 ?m2 dr ?c1 dr ?c3)
                (not (current_position ?m1 ?m2 stg ?c1 stg ?c3)))
    )
    (:action moveM3C3SD
        :parameters (?m1 ?m2 ?c1 ?c2)
        :precondition (and  (current_position ?m1 ?m2 stg ?c1 ?c2 stg)
                            (valid_state ?m1 ?m2 dr ?c1 ?c2 dr))
        :effect (and (current_position ?m1 ?m2 dr ?c1 ?c2 dr)
                (not (current_position ?m1 ?m2 stg ?c1 ?c2 stg)))
    )
    (:action moveC1C2SD
        :parameters (?m1 ?m2 ?m3 ?c3)
        :precondition (and  (current_position ?m1 ?m2 ?m3 stg stg ?c3)
                            (valid_state ?m1 ?m2 ?m3 dr dr ?c3))
        :effect (and (current_position ?m1 ?m2 ?m3 dr dr ?c3)
                (not (current_position ?m1 ?m2 ?m3 stg stg ?c3)))
    )
    (:action moveC1C3SD
        :parameters (?m1 ?m2 ?m3 ?c2)
        :precondition (and  (current_position ?m1 ?m2 ?m3 stg ?c2 stg)
                            (valid_state ?m1 ?m2 ?m3 dr ?c2 dr))
        :effect (and (current_position ?m1 ?m2 ?m3 dr ?c2 dr)
                (not (current_position ?m1 ?m2 ?m3 stg ?c2 stg)))
    )
    (:action moveC2C3SD
        :parameters (?m1 ?m2 ?m3 ?c1)
        :precondition (and  (current_position ?m1 ?m2 ?m3 ?c1 stg stg)
                            (valid_state ?m1 ?m2 ?m3 ?c1 dr dr))
        :effect (and (current_position ?m1 ?m2 ?m3 ?c1 dr dr)
                (not (current_position ?m1 ?m2 ?m3 ?c1 stg stg)))
    )
    
    (:action moveM1M2DS
        :parameters (?m3 ?c1 ?c2 ?c3)
        :precondition (and  (current_position dr dr ?m3 ?c1 ?c2 ?c3)
                            (valid_state stg stg ?m3 ?c1 ?c2 ?c3))
        :effect (and (current_position stg stg ?m3 ?c1 ?c2 ?c3)
                (not (current_position dr dr ?m3 ?c1 ?c2 ?c3)))
    )
    (:action moveM1M3DS
        :parameters (?m2 ?c1 ?c2 ?c3)
        :precondition (and  (current_position dr ?m2 dr ?c1 ?c2 ?c3)
                            (valid_state stg ?m2 stg ?c1 ?c2 ?c3))
        :effect (and (current_position stg ?m2 stg ?c1 ?c2 ?c3)
                (not (current_position dr ?m2 dr ?c1 ?c2 ?c3)))
    )
    (:action moveM1C1DS
        :parameters (?m2 ?m3 ?c2 ?c3)
        :precondition (and  (current_position dr ?m2 ?m3 dr ?c2 ?c3)
                            (valid_state stg ?m2 ?m3 stg ?c2 ?c3))
        :effect (and (current_position stg ?m2 ?m3 stg ?c2 ?c3)
                (not (current_position dr ?m2 ?m3 dr ?c2 ?c3)))
    )
    (:action moveM1C2DS
        :parameters (?m2 ?m3 ?c1 ?c3)
        :precondition (and  (current_position dr ?m2 ?m3 ?c1 dr ?c3)
                            (valid_state stg ?m2 ?m3 ?c1 stg ?c3))
        :effect (and (current_position stg ?m2 ?m3 ?c1 stg ?c3)
                (not (current_position dr ?m2 ?m3 ?c1 dr ?c3)))
    )
    (:action moveM1C3DS
        :parameters (?m2 ?m3 ?c1 ?c2)
        :precondition (and  (current_position dr ?m2 ?m3 ?c1 ?c2 dr)
                            (valid_state stg ?m2 ?m3 ?c1 ?c2 stg))
        :effect (and (current_position stg ?m2 ?m3 ?c1 ?c2 stg)
                (not (current_position dr ?m2 ?m3 ?c1 ?c2 dr)))
    )
    (:action moveM2M3DS
        :parameters (?m1 ?c1 ?c2 ?c3)
        :precondition (and  (current_position ?m1 dr dr ?c1 ?c2 ?c3)
                            (valid_state ?m1 stg stg ?c1 ?c2 ?c3))
        :effect (and (current_position ?m1 stg stg ?c1 ?c2 ?c3)
                (not (current_position ?m1 dr dr ?c1 ?c2 ?c3)))
    )
    (:action moveM2C1DS
        :parameters (?m1 ?m3 ?c2 ?c3)
        :precondition (and  (current_position ?m1 dr ?m3 dr ?c2 ?c3)
                            (valid_state ?m1 stg ?m3 stg ?c2 ?c3))
        :effect (and (current_position ?m1 stg ?m3 stg ?c2 ?c3)
                (not (current_position ?m1 dr ?m3 dr ?c2 ?c3)))
    )
    (:action moveM2C2DS
        :parameters (?m1 ?m3 ?c1 ?c3)
        :precondition (and  (current_position ?m1 dr ?m3 ?c1 dr ?c3)
                            (valid_state ?m1 stg ?m3 ?c1 stg ?c3))
        :effect (and (current_position ?m1 stg ?m3 ?c1 stg ?c3)
                (not (current_position ?m1 dr ?m3 ?c1 dr ?c3)))
    )
    (:action moveM2C3DS
        :parameters (?m1 ?m3 ?c1 ?c2)
        :precondition (and  (current_position ?m1 dr ?m3 ?c1 ?c2 dr)
                            (valid_state ?m1 stg ?m3 ?c1 ?c2 stg))
        :effect (and (current_position ?m1 stg ?m3 ?c1 ?c2 stg)
                (not (current_position ?m1 dr ?m3 ?c1 ?c2 dr)))
    )
    (:action moveM3C1DS
        :parameters (?m1 ?m2 ?c2 ?c3)
        :precondition (and  (current_position ?m1 ?m2 dr dr ?c2 ?c3)
                            (valid_state ?m1 ?m2 stg stg ?c2 ?c3))
        :effect (and (current_position ?m1 ?m2 stg stg ?c2 ?c3)
                (not (current_position ?m1 ?m2 dr dr ?c2 ?c3)))
    )
    (:action moveM3C2DS
        :parameters (?m1 ?m2 ?c1 ?c3)
        :precondition (and  (current_position ?m1 ?m2 dr ?c1 dr ?c3)
                            (valid_state ?m1 ?m2 stg ?c1 stg ?c3))
        :effect (and (current_position ?m1 ?m2 stg ?c1 stg ?c3)
                (not (current_position ?m1 ?m2 dr ?c1 dr ?c3)))
    )
    (:action moveM3C3DS
        :parameters (?m1 ?m2 ?c1 ?c2)
        :precondition (and  (current_position ?m1 ?m2 dr ?c1 ?c2 dr)
                            (valid_state ?m1 ?m2 stg ?c1 ?c2 stg))
        :effect (and (current_position ?m1 ?m2 stg ?c1 ?c2 stg)
                (not (current_position ?m1 ?m2 dr ?c1 ?c2 dr)))
    )
    (:action moveC1C2DS
        :parameters (?m1 ?m2 ?m3 ?c3)
        :precondition (and  (current_position ?m1 ?m2 ?m3 dr dr ?c3)
                            (valid_state ?m1 ?m2 ?m3 stg stg ?c3))
        :effect (and (current_position ?m1 ?m2 ?m3 stg stg ?c3)
                (not (current_position ?m1 ?m2 ?m3 dr dr ?c3)))
    )
    (:action moveC1C3DS
        :parameters (?m1 ?m2 ?m3 ?c2)
        :precondition (and  (current_position ?m1 ?m2 ?m3 dr ?c2 dr)
                            (valid_state ?m1 ?m2 ?m3 stg ?c2 stg))
        :effect (and (current_position ?m1 ?m2 ?m3 stg ?c2 stg)
                (not (current_position ?m1 ?m2 ?m3 dr ?c2 dr)))
    )
    (:action moveC2C3DS
        :parameters (?m1 ?m2 ?m3 ?c1)
        :precondition (and  (current_position ?m1 ?m2 ?m3 ?c1 dr dr)
                            (valid_state ?m1 ?m2 ?m3 ?c1 stg stg))
        :effect (and (current_position ?m1 ?m2 ?m3 ?c1 stg stg)
                (not (current_position ?m1 ?m2 ?m3 ?c1 dr dr)))
    )
)

在这里,我定义了所有可能的操作,包括:

  1. 每个人都可以独自从一岸渡河到另一岸。
  2. 每个人都可以与其他人一起过河,从一个海岸到另一个海岸。

我做了这些记号: moveXSD当某人独自在船上从左到右 moveXYSD过河时 当某人与另一个人从左到右过河时 当某人 独自在船上从左到右moveXSD过河时船 moveXYDS是当某人与另一个人从右到左过河personmoveXSD时是当某人从左到右独自过河时 在船上 moveXYDS是当某人与另一个人从右到左过河时 m1 m2 m3代理人和c1 c2 c3食人族 stg代表左 dr代表右

考虑到我刚刚开始使用这种编程语言,我希望我没有犯新手错误。请让我知道我是否遗漏了什么,或者没有给你所有需要的细节。

4

1 回答 1

1

错误消息是说您正在使用带有太多参数的操作。您需要找到一种方法将其减少到最多 5 个参数,或者使用不同的规划器。

于 2022-01-03T23:33:51.240 回答