当前,我在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))
.
.
.
)