PDDL

What is planning

“Planning is a discipline of Artificial Intelligence that aims at the development of generic algorithms allowing autonomous systems to choose and organize their actions to achieve a goal by anticipating their effects
---------- (Ghallab, M. and al., 2004)”

From automated planning in a nutshell

Planning languages

人们输入高层指令,由编译器抽象后编译。
youtube IIT AI tutorial
(extention courses)

  • assumptions:
  1. space is finite
  2. fully observable : perfect perception
  3. static: only agent can change the world
  4. deterministic: action won’t fail
  5. simple goal: goals only be tested in final state. We do not have trajectory constraints. Also, we do not relax our goal(soft constraint).
  6. plan as sequence, not networks.
  7. do not do thing in parallel, i.e., durative actions.
  • effects: modify the state by adding the predicate if true, deleting the predicate if false

PDDL syntax

PDDL 就是一门语言,跟一般的面向对象语言一样有自己的语法规则。
‘-’ 代表从属关系,city, place, physobj 等属于object

(:types city place physobj - object
          package vehicle - physobj
          truck airplane - vehicle	
          airport location - place
  )

‘?’代表变量,放在谓语(predicates,(templates for logical facts))中

(:predicates (in-city ?loc - place ?city - city)
	     (at ?obj - physobj ?loc - place)
	     (in ?pkg - package ?veh - vehicle))

初始状态

初始状态是一系列ground predicates的集合。 ground predicates中变量不需要加‘?’ ,因为都是真的。

(:init (in-city cdg paris)
       (in-city lhr london)
       (in-city north paris)
       (in-city south paris)
       (at plane lhr)
       (at truck cdg)
       (at p1 lhr)
       (at p2 lhr)
  )

domain file

  • 首先定义一系列object, 包含 robot, 地点,pkg
;; Defining types
(:types
  robot - agent
  conveyor unit - location
  piece operation tray - object
)
  • 定义一些约束, 比如最后需要停止
(:constants
      stop - operation
)

之后需要对domain建模了。

  • 定义一些predicates, 也是词汇表,类似于cpp的class定义数据结构以及一些状态的assertion(盘子在机器人上)。
(:predicates
    ;robot
    (robot_available ?robot - robot)
    ;; is the robot available? capacity is one
    (robot_at ?robot - robot ?l - location)
    ;; location of a robot. Either a conveyor or a unit

    ;conveyor
    (conveyor_accepted_piece ?piece - piece ?conv - conveyor)
    ;; constraint on admissible pieces
    (conveyor_available ?conv - conveyor)
    ;; is the conveyor available? capacity is one
    (conveyor_unit ?conv - conveyor ?unit - unit)
    ;; "one-to-many" relation between units and conveyors
...
)
  • 之后要定义一些action,比如运输盘子之类。
(:action drop_tray_on_conveyor
    :parameters (?robot - robot ?conv - conveyor ?tray - tray ?piece - piece)
    :precondition (and (conveyor_available ?conv)
                       (robot_at ?robot ?conv)
                       (tray_on_robot ?tray ?robot)
                       (conveyor_accepted_piece ?piece ?conv)
                       (piece_on ?piece ?tray)
                  )
    :effect (and (not (conveyor_available ?conv))
                 (not (tray_on_robot ?tray ?robot))
                 (tray_on_conv ?tray ?conv)
                 (robot_available ?robot))
)

PDDL4J web

PDDL4J web app

PDDL WEB EDITOR

下面隆重介绍一款PDDL网页编辑器以及solver生成器:planning.domains。开发者在youtube上有一段教学,我直接搬运过来。

episode 1

打开网页,选择editor进入。editor
选择“load”,输入远程仓库密码zs0KNVYtQr。
load

看到许多现成的pddl文件。将其导入vscode:
在这里插入图片描述
将会自动打开vscode并提示你下载插件。
你可以打开pddl的problem文件,选择在线找solver:
在这里插入图片描述
找到了!虽然本小白看不太懂。
在这里插入图片描述

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值