乙個PDDL簡單教程

2021-10-05 20:44:49 字數 1730 閱讀 5115

(照例mark一下學習收穫)

我的理解是,這是乙個strips的模型實現語言

pddl➡️planner➡️plan

對於strips來說,包含的元素有

p(predicates)

f(fluents/facts)

i(only one initial state)

g(a set of goal states)

o(operator)

1)乙個domain file:

主要含type,predicates,action的precondition,add, delete的操作

2)乙個problem file:

含initial state和goal state

1)online pddl:

2)vscode:

extensions裡面install pddl

然後,執行的時候,雙擊對應的domain file和problem file,保證上面選單只有這兩個被開啟,然後執行快捷鍵是option+p(mac)

注意這個exists一定要加s,不然就一直報錯說『(』問題。。。ps出現這種報錯問題可以先看看語法有沒有錯,單詞拼寫有沒有錯

假設type中定義了乙個type叫做node

(

:types

node

)

我們有個predicates叫做(cat ?pos - node),意思是在這個position上有只貓

官方document對exist的定義是(exists (node)(condition))

eg:

(exists

(?pos - node)

(cat ?pos)

)

意思是,存在位置上有貓的位置

能用在precondition formula和effect formula

forall用法和exists差不多

eg:

(forall

(?pos - node)

(cat ?pos)

)

意思是,對所有位置上有貓的點

只能用在precondition formula

and:

括號內兩個條件都為真(and(predicate_1)(predicate_2)),則整個才為真;

or:括號內只要有乙個條件為真(or(predicate_1)(predicate_2)),整個為真;

not:

(not(predicate))

(= ?pos1 ?pos2)

條件判斷,用在effect formula

when(

(predicate_1)

(predicate_2)

)

當predicate_1發生時,執行predicate_2

pddl得到的不一定是optimal,他只負責給出乙個plan,他的結果取決於使用的solver

乙個example:

乙個簡單的makefile教程

寫makefile是乙個非常便利的編譯方法,由於以前習慣把所有的 都集中在乙個檔案中,體現不出make的優勢,當把源 拆分成若干個原始檔,makefile就顯得必要了。以下是乙份簡單的makefile的教程,參考自a makefile tutorial。正如原文所說,這份教程只是打算讓初學者快速入門...

libhv教程10 建立乙個簡單的HTTP服務端

http協議作為本世紀最通用的應用層協議,本文就不加以介紹了,不熟悉的自行閱讀awesome http 示例 參考examples http server test.cpp 編譯執行 bin http server test測試使用curl或瀏覽器輸入以下url curl v curl v curl...

乙個簡單php擴充套件介紹與開發教程

我們使用php擴充套件,主要目的www.cppcns.com是提高程式的執行效率,對於訪問量很大的 或者邏輯將其寫成擴充套件。在做專案的過cjfxl程中,需要對資料進行排序,資料運算比較複雜 我們準備對一百萬個資料進行排序,下面是我在程式之前做的乙個測試 首先使用php程式生成一百萬的隨機數,並將其...