0

Currently, I implement an AI planner in PDDL to turn on and turn off a number of different devices in the house according to the information detected by multisensor. I do not know how to set one common goal for many tasks (like fan, light, door...) and also the turn on and turn off how we can set both to be true in the goal? The init state will be either turn on or turn off. It will be the same as one of the goals. Any suggestion to make a better goal in this cases?

(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))
.
.
.
    )
Simon
  • 5,464
  • 6
  • 49
  • 85
Thinsheep
  • 39
  • 3
  • Is this supposed to be a sketch, an exercise or the real™ thing? Because it doesn't sound right to not have a timer in your sketch model, unless that's embedded in the motion sensor. Can you provide more information about your desired state? What is the target temperature? (also, why only `hot` and `cold` and not `just right`?) Do you wish to normally keep lights on or off? (i.e. are you fine with random light blinking?) – Patrick Trentin Jul 07 '19 at 06:44
  • Is this a planning problem? Does one decision (e.g. switching a light on) influence whether other decisions may be taken? Would it be simple to use a if-this-than-that framework? But if PDDL gives you some advantages why not. Then is it possible in your world that it is hot and cold at the same time? Because that range could be interpreted as "just fine" and the fan would not oscillate on/off. – Jan Dolejsi Jul 09 '19 at 21:26

0 Answers0