0

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

(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))
.
.
.
    )
4

0 回答 0