Further information on planning under partial observability can be found
here.
Consider the example depicted below. An electricity distribution
network must be configured in order to light a bulb, using some
switches (s1,...,s6,sw,cb). Some lines
may be faulty. When a faulty line is fed, cb reopens in order
to protect the generator. Also, switch s3 is unreliable: it may not respond to the
open/close command. The only available sensor pw detects whether power has reached
the bulb switch or not.
(define (domain supplyrestoration)
(:types device line)
(:constants
cb s1 s2 s3 s4 s5
s6 - device
l12 l56 - line)
(:predicates
(closed ?d -
device)
(faulty ?l -
line))
(:functions
(switch_position)
- (range 1 3))
(:action open_device
:parameters (?d - device)
:precondition (closed ?d)
:effect
(not (closed ?d)))
(:action set_switch
:parameters (?pos - (range 1 3))
:precondition (not (= ?pos (switch_position)))
:effect
(assign (switch_position) ?pos))
(:action close_device
:parameters (?d - device)
:precondition (not (closed ?d))
:effect (and
(when (and
(not (= ?d cb))
(not (= ?d s3)))
(closed ?d))
(when (and
(= ?d cb)
(not (and (closed s1) (faulty l12)))
(not (and (closed s5) (faulty l56))))
(closed ?d))
(when (= ?d s3)
(unknown (closed ?d)))
(when (and
(closed cb)
(or
(and (= ?d s1) (faulty l12))
(and (= ?d s5) (faulty l56))))
(not (closed cb)))))
(:observation power_reaches_switch - boolean
:parameters ()
(iff (= power_reaches_switch
1)
(or
(and (closed cb)
(closed s1)
(closed s2))
(and (closed cb)
(closed s3)
(closed s4))
(and (closed cb)
(closed s5)
(closed s6))))
)
)
The following problem describes a situation where one of l12 , l56 is faulty, and we intend to light the bulb.
(define (problem supply_pb)
(:domain
supply_restoration)
(:init (= (switch_position) 1)
(oneof (faulty l12) (faulty l56)))
(:postronggoal
(or
(and (closed cb)
(closed s1)
(not (faulty l12))
(closed s2)
(= (switch_position) 1))
(and (closed cb)
(closed s3)
(closed s4)
(= (switch_position) 2))
(and (closed cb)
(closed s5)
(not (faulty l56))
(closed s6)
(= (switch_position) 3)))))
To solve the problem, run
MBP-solve -plan_output - <domain> <problem>
where <domain> and <problem> are the domain
and problem above.