经典规划PDDL-积木世界

基于PDDL通用规划语言的积木世界规划求解

1 积木世界问题描述

在这里插入图片描述

2 PDDL求解

2.1 domain

在这里插入图片描述

2.2 problem

在这里插入图片描述

3 求解结果

在这里插入图片描述

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,假设我们有以下 PDDL 领域和问题描述: ``` (define (domain blocksworld) (:requirements :strips :typing) (:types block) (:predicates (on ?x - block ?y - block) (ontable ?x - block) (clear ?x - block) (holding ?x - block)) (:action pickup :parameters (?x - block) :precondition (and (ontable ?x) (clear ?x)) :effect (and (holding ?x) (not (ontable ?x)) (not (clear ?x)))) (:action putdown :parameters (?x - block) :precondition (holding ?x) :effect (and (ontable ?x) (clear ?x) (not (holding ?x)))) (:action moveToTable :parameters (?x - block) :precondition (and (clear ?x) (not (ontable ?x))) :effect (and (ontable ?x) (not (clear ?x)))) (:action move :parameters (?x - block ?y - block) :precondition (and (clear ?x) (not (ontable ?x)) (clear ?y)) :effect (and (on ?x ?y) (clear ?x) (not (clear ?y)) (not (on ?x ?z)))) ) (define (problem blocks-4) (:domain blocksworld) (:objects a b c) (:init (ontable b) (ontable c) (clear a) (clear b) (clear c)) (:goal (and (on a b) (on b c) (ontable c)))) ``` 现在我们需要实现 `move` 动作。在 `move` 动作中,我们需要给出两个积木参数 `?x` 和 `?y`,将 `?x` 放到 `?y` 上面。 我们可以使用 `forall` 关键字来描述 “所有的积木 `?i` 都不在 `?y` 上面” 的条件,然后使用 `when` 关键字来实现 “当所有的积木 `?i` 都不在 `?y` 上面时,才可以执行 `move` 动作”。 具体来说,我们可以这样实现 `move` 动作: ``` (:action move :parameters (?x - block ?y - block) :precondition (and (clear ?x) (not (ontable ?x)) (clear ?y) (forall (?i - block) (not (on ?i ?y)))) :effect (and (on ?x ?y) (clear ?x) (not (clear ?y)) (forall (?i - block) (when (on ?i ?x) (not (on ?i ?y)))) (not (on ?x ?z)))) ``` 其中,`(forall (?i - block) (not (on ?i ?y)))` 表示所有的积木 `?i` 都不在 `?y` 上面,`(forall (?i - block) (when (on ?i ?x) (not (on ?i ?y))))` 表示所有在 `?x` 上面的积木 `?i` 都被移动到了 `?y` 上面。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值