Failed to parse the problem — EOL while scanning string literal (, line 43)

huangapple go评论103阅读模式
英文:

Failed to parse the problem -- EOL while scanning string literal (, line 43)

问题

你的问题在这行代码:piece1x2-1 piece1x2-2 piece1x2-3 piece1x2-4 - piece 中,应该是 piece1x2-1 piece1x2-2 piece1x2-3 piece1x2-4 - piece

英文:

i am fetting error : /tmp/solver_planning_domains_tmp_2lmCSmQMYFyo5/problem.pddl: syntax error in line 14, '0':
'define' expected

my problem.pddl is

    (define (problem klotski)
  (:domain klotski)

 
  (:objects
    piece2x2 - piece
    piece2x1 - piece
    piece1x2-1 piece1x2-2 piece1x2-3 piece1x2-4 - piece
    piece1x1-1 piece1x1-2 piece1x1-3 piece1x1-4 - piece
    exit - piece
  )

  (:init
    (at piece2x2 0 0)
    (at piece2x1 0 2)
    (at piece1x2-1 0 4)
    (at piece1x2-2 2 0)
    (at piece1x2-3 2 2)
    (at piece1x2-4 2 4)
    (at piece1x1-1 3 0)
    (at piece1x1-2 3 1)
    (at piece1x1-3 3 3)
    (at piece1x1-4 3 4)
    (at exit 1 4)
    (empty 1 0) (empty 1 1) (empty 1 3) (empty 1 4)
    (empty 2 1) (empty 2 3) (empty 3 2)
  )


  (:goal
    (and
      (at piece2x2 1 3)
      (empty 0 0) (empty 0 1) (empty 0 3) (empty 0 4)
      (empty 2 0) (empty 2 1) (empty 2 3) (empty 2 4)
      (empty 3 0) (empty 3 1) (empty 3 3) (empty 3 4)
      (empty 1 1) (empty 1 3) (empty 2 1) (empty 2 3)
    )
  )
)

where is the problem?
the assignment is - Klotski is a sliding puzzle problem. There is one 2×2 piece, one 2 × 1 piece, four 1 × 2 pieces, and four 1 × 1 pieces. Initially, the pieces are placed on a 4 × 5 board, as shown in the following Figure. The goal of the game is to slide the 2 × 2 piece to the exit. No pieces can be removed from the board and pieces can only be slid to the empty spaces horizontally or vertically.

答案1

得分: 1

不要认为你应该在流畅的代码中使用原始数字。3 应该是 num3,等等。

英文:

Don't think you should be using raw numbers in fluents like that. 3 should be num3, etc.

huangapple
  • 本文由 发表于 2023年5月14日 01:45:16
  • 转载请务必保留本文链接:https://go.coder-hub.com/76244137.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定