Welcome to Help

Help
2008-01-22
2012-11-23
  • Nobody/Anonymous

    Welcome to Help

     
    • Shamil Mostov

      Shamil Mostov - 2008-03-14

      How to activate did rules?
      This my code:

      (deffacts today
         (today is Sunday)
         (weather is warm) )

      Why after this instruction execution, the facts of (wash car) and (chop wood) not added to the base?
      (defrule chores
         (salience 10)
         (today is Sunday)
         (weather is warm) =>
         (assert (wash car))
         (assert (chop wood) ) )

      I am sorry for my English:)

       
      • Gary Riley

        Gary Riley - 2008-03-17

        CLIPS>
        (deffacts today
           (today is Sunday)
           (weather is warm))
        CLIPS> 
        (defrule chores
           (salience 10)
           (today is Sunday)
           (weather is warm)
           =>
           (assert (wash car))
           (assert (chop wood)))
        CLIPS> (reset)
        CLIPS> (run)
        CLIPS> (facts)
        f-0     (initial-fact)
        f-1     (today is Sunday)
        f-2     (weather is warm)
        For a total of 3 facts.
        CLIPS>

         
    • Shamil Mostov

      Shamil Mostov - 2008-03-18

      Thanks!!!

       

Log in to post a comment.