在PDDL中为may对象设置目标的问题

2024-09-26 18:11:52 发布

您现在位置:Python中文网/ 问答频道 /正文

目前,我在PDDL中实现了一个人工智能规划器,根据多传感器检测到的信息来开启和关闭室内的多个不同设备。我不知道如何为许多任务(如风扇、灯、门……)设定一个共同的目标,以及如何开启和关闭这两个目标?初始化状态将是打开或关闭。这将是相同的目标之一。在这种情况下,有什么建议可以制定一个更好的目标吗?你知道吗

(define (problem pb_smarthome)
    (:domain smarthome)

    (:objects
        detected nodetected - motionsensor
        hot cold - temperaturesensor
        lighton lightoff -light
        fanon fanoff -fan )

    (:init (at-light nodetected lightoff)
           (at-fan cold fantoff)
    )

    (:goal (and (at-light detected lighton)
                (at-light nodetected lightoff)
                (at-light hot fanton)
                ......  ))
)

(define (domain smarthome)

    (:requirements :strips :typing)

    (:type motionsensor temperaturesensor light fan - object)

    (:predicates (at-light ?x - motionsensor ?y - light)
                 (at-fan ?x - temperaturesensor ?y - fan))

    (:action turnlighton
        :parameter (?x - motionsensor ?y - light)
        :precondition (not(at-light ?x ?y))
        :effect (at-light ?x ?y)

    (:action turnlightoff
        :parameter (?x - motionsensor?y - light)
        :precondition (at-light ?x ?y)
        :effect (not(at-light ?x ?y))

    (:action turnfanon
        :parameter (?x - temperaturesensor?y - light)
        :precondition (at-light ?x ?y)
        :effect (not(at-light ?x ?y))
.
.
.
    )

Tags: 目标parameternotactionatlighteffectfan

热门问题