Hi all, 
 I am only trying to create a plan for the cube's problem. A little one,
only to understand how Jess work with with plans, but I actually do not
know what I should do about the goal-is-to predicat. 

Here is my code, can anyone help me! Thank you so much!
Daniela
(clear)

(watch all)

(facts)

(deftemplate goal-is-to 
   (slot arm)
   (slot null))


(assert (arm empty) (in c1 cubeA) (in c2 cubeA) (null cubeB) )

(assert (goal-is-to (arm empty) (in c1 cubeB) (in c2 cubeB) (null
cubeA)))


(bind ?Cube cubeA)
(bind ?Cube cubeB)
(bind ?Box c1)
(bind ?Box c2)

(defrule take 
        ?arm <- (arm empty)
        ?in <- (in ?Box ?Cube)
        
=>
        (printout t "Take" ?Box ?Cube crlf)
        (assert (arm ?Box))
        (retract ?in ?arm)
        
)

(defrule put  
        ?arm <- (arm ?Box)
        (not (arm empty))
=>
        (printout t "Put" ?Box ?Cube crlf)
        
        (assert (in ?Box ?Cube) (arm empty) )
        
        (goal-is-to (arm empty) (null ?Cube) )
        
        (retract ?arm)
)



(run)


--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to