Syntax error in solving the domain and problem

55 views Asked by At

PDDL Domain:

(define (domain underwater-exploration)
  (:requirements :strips :typing)
  
  (:types
    location - object
    sub personnel - object
    scientist engineer pilot - personnel
    land shallow-water deep-water command-centre - location
  )

  (:predicates
    (at ?s - sub ?l - location)
    (onboard ?p - personnel ?s - sub)
    (shallow-water ?l - location)
    (deep-water ?l - location)
    (land ?l - location)
    (command-centre ?l - location)
  )

  (:action move
    :parameters (?s - sub ?from - location ?to - location ?p - pilot)
    :precondition (and
      (at ?s ?from)
      (onboard ?p ?s)
      (or (and (shallow-water ?from) (shallow-water ?to))
          (and (deep-water ?from) (deep-water ?to))
      )
    )
    :effect (and
      (not (at ?s ?from))
      (at ?s ?to)
    )
  )
)

PDDL Problem:

(define (problem carry-construction-kit)
  (:domain underwater-exploration)
  
  (:objects
    s1 - sub
    p1 - pilot
    cw1 - command-centre
    sw1 - shallow-water
    dw1 - deep-water
    l1 l2 l3 - location
  )

  (:init
    (at s1 cw1)
    (onboard p1 s1)
    (at cw1 l1)
    (shallow-water sw1)
    (deep-water dw1)
    (land l2)
    (command-centre l3)
  )

    (:goal
    (forall (?s - sub ?p - pilot ?l - location)
      (when (onboard ?p ?s)
        (and
          (at ?s ?l)
          (or (shallow-water ?l) (deep-water ?l))
        )
      )
    )
  )
)

I'm trying to solve the PPDL problem for Q2.

X Underwater has decided to continue its exploration activities in the sea. Mission operations will be controlled by plans generated using an automated planner that will direct the activities of personnel and underwater vehicles. The area of operation is divided into a series of grid-based locations involving land and water. A command centre, which acts as a base of operations, is in one of the water locations near the land. Several types of personnel serve at the command centre, including engineers, scientists, and pilots. The main activities are performed by advanced subs, which can travel underwater and perform various types of exploration and construction tasks. All personnel and subs initially begin at the command centre. Some of the operations of the underwater mission are described in the following list (which isn’t exhaustive):

  1. Each location in the area of operation can be either land, shallow water, or deep water.
  2. A sub can only move in shallow or deep water and must have a pilot on board in order to move. A sub can only move to an adjacent location from its current location (i.e., it may take multiple moves to reach distant locations).

and my error: Suspected timeout.

/tmp/solver_planning_domains_tmp_2LQY988hoCyEd/problem.pddl: syntax error in line 25, '(': 'define' expected

I'm using PDDL Editor to solve.

1

There are 1 answers

0
nirlipo On

Try to reformulate your goal without using conditional effects.