Steffen, a few general remarks based on guesswork as to what might be intended by these facts and rules.
Whenever there is a fact that represents a dynamic process, make sure to change that fact rather than asserting a new one. (modify Verzug, not assert another one.) It might help to combine the verzug values with a "state" slot that indicates the stage of the process. Rather than using a boolean, use an enum (or a symbol) to denote the processing stage, e.g., from "raw" to "mounted" to "drilled" or whatever. Again, make sure to modify this ProcessStage fact rather than asserting a new one. This would also apply if you intend to have several processing rules in parallel, depending on the Werkstück's processing requirements. HTH -W On Mon, Jul 13, 2009 at 7:59 PM, Steffen Niermann<[email protected]> wrote: > Hello, > > I have a problem with defining a rule without getting into an infinite loop. > > > > This is my code: > > > > (deftemplate Werkstueck > > (slot Einspannungsart) > > (slot Hauptprozess) > > (slot Name)) > > (deftemplate Verzug (declare (slot-specific TRUE)) > > (slot v1) > > (slot v2)) > > (deftemplate noloops > > (slot einspannennl) ) > > > > (defrule einspannen > > (Werkstueck (Einspannungsart "Segmentbackenabdruck")) > > (noloops (einspannennl 0)) > > ?v1 <- (Verzug (v1)) > > => > > (assert (noloops (einspannennl 1))) > > (assert (Verzug (v1 (+ ?v1 2))))) > > > > > > I want to add more rules like „einspannen“. When I use (declare (no-loop > TRUE)) the other rules won´t be fired. > > So I added the SLOT “einspannennl” which should be “0” on the LHS. If the > rule is fired the slot will be set “1”. > > I thought that I could avoid an infinite loop with this slot. > > Still it runs into an infinite loop, if fired. > > > > Can you help me with avoiding an infinite loop? > > > > Thank you very much. > > > > Best Regards > > Steffen N. > > > > > > ________________________________ > > BIBA - Bremer Institut fuer Produktion und Logistik GmbH > Postanschrift: Postfach P.O.B. 33 05 60, D-28335 Bremen / Germany > Geschaeftssitz: Hochschulring 20, D-28359 Bremen / Germany > USt-ID: DE814890109, Amtsgericht Bremen HRB 24505 HB > Tel: +49(0)421/218-5576, Fax: +49(0)421/218-5640 > E-Mail: [email protected], Internet: www.biba.uni-bremen.de > Geschaeftsfuehrer: Prof. Dr.-Ing. Bernd Scholz-Reiter > -------------------------------------------------------------------- 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]. --------------------------------------------------------------------
