Планировщик STRIPS не компилируется
Я работал над проектом об известной проблеме лиса-гусь-бобы-фермер. Я пытаюсь реализовать это на основе браузера компилятор, который является https://stripsfiddle.herokuapp.com/. Все функции, кроме moveFoxAcross и moveFoxBack, работают. Я не мог видеть никаких недостатков. Может кто-то указать на мою ошибку или предложить какой-либо действительный источник синтаксиса. Вот мой код домена:
(define (domain domain-FGB)
(:requirements :strips :typing)
(:types fox goose beans farmer onLeftBank)
(:action moveGooseAcross
:parameters (?g - goose ?l - onLeftBank ?f - farmer)
:precondition (and (not (at ?g ?l)) (not (at ?f ?l)))
:effect (and (at ?g ?l) (at ?f ?l))
)
(:action moveFoxAcross
:parameters (?fo - fox ?l - onLeftBank ?f - farmer ?b - beans ?g - goose)
:precondition (and (not (at ?fo ?l)) (not (at ?f ?l))(or (and (not (at ?b ?l)) (at ?g ?l)) (and (at ?b ?l) (not (?g ?l)))))
:effect (and (at ?fo ?l) (at ?f ?l))
)
(:action moveBeansAcross
:parameters (?b - beans ?fo - fox ?l - onLeftBank ?f - farmer ?g - goose)
:precondition (and (not (at ?b ?l)) (not (at ?f ?l))(or (and (not (at ?fo ?l)) (at ?g ?l)) (and (at ?fo ?l) (not (at ?g ?l)))))
:effect (and (at ?b ?l) (at ?f ?l))
)
(:action farmerAcrossRiver
:parameters (?f - farmer ?l - onLeftBank)
:precondition (not (at ?f ?l))
:effect (at ?f ?l)
)
(:action moveGooseBack
:parameters (?g - goose ?l - onLeftBank ?f - farmer)
:precondition (and (at ?g ?l) (at ?f ?l))
:effect (and (not (at ?g ?l)) (not (at ?f ?l))))
(:action moveFoxBack
:parameters (?fo - fox ?l - onLeftBank ?f - farmer ?b - beans ?g - goose)
:precondition (and (at ?fo ?l) (at ?f ?l) (or (and (not (at ?b ?l)) (at ?g ?l)) (and (at ?b ?l) (not (?g ?l)))))
:effect (and (not (at ?fo ?l)) (not (at ?f ?l))))
(:action moveBeansBack
:parameters (?b - beans ?fo - fox ?l - onLeftBank ?f - farmer ?g - goose)
:precondition (and (at ?b ?l) (at ?f ?l)(or (and (not (at ?fo ?l)) (at ?g ?l)) (and (at ?fo ?l) (not (at ?g ?l)))))
:effect (and (not (at ?b ?l)) (not (at ?f ?l))))
(:action farmerGoesBack
:parameters (?f - farmer ?l - onLeftBank)
:precondition (at ?f ?l)
:effect (not (at ?f ?l))
))
Вот мой код проблемы:
(define (problem FGB)
(:domain domain-FGB)
(:objects
FOX - fox
GOOSE - goose
BEANS - beans
FARMER - farmer
ONLEFTBANK - onLeftBank)
(:init
(and (not(at FOX ONLEFTBANK)) (not(at GOOSE ONLEFTBANK)) (not(at FARMER ONLEFTBANK)) (not(at BEANS ONLEFTBANK))))
(:goal (and (at FOX ONLEFTBANK) (at GOOSE ONLEFTBANK) (at FARMER ONLEFTBANK) (at BEANS ONLEFTBANK))))
Вот мой вопрос:
- только функции moveFoxAcross и moveFoxBack не работают и выдают ошибку компиляции. Можете ли вы помочь мне понять почему?.
- даже если я компилирую без них, это дает мне 0 решений.
- Есть ли пример, который может помочь мне решить этот вопрос?
Вы можете просто выбрать "Создать свой собственный" из списка в разделе домена и скопировать / вставить мой код, чтобы попробовать его самостоятельно.
заранее спасибо
1 ответ
Проблема в том, что во втором пункте и в предложении второго или предложения отсутствует "at". Столица AT ниже.
:precondition (and
(not (at ?fo ?l))
(not (at ?f ?l))
(or (and
(not (at ?b ?l))
(at ?g ?l)
)
(and
(at ?b ?l)
(not (AT ?g ?l))
)
)
)
Но я не мог найти решение с этой поправкой. Я продолжаю работать и сообщу, если найду решение.