Re: JESS: changing facts in a fact file
JESS simply loads the file and forgets about it. If you want to monitor a file, you'll have to do that yourself and then call clear and batch. If you don't want to reload the entire file, you'll have to maintain state and keep track of the last line and then only assert the new facts. why not just send the new facts to JESS directly? peter On Wed, Mar 11, 2009 at 10:30 AM, Tanja Vicovac tanja.vico...@tuwien.ac.at wrote: Hi, I have to create a KBS with a fact-file, which is extended every 10 minutes. I think it's possible to check in a certain intervall if the facts-file is changing or not (like polling), but is there another possibility? How does JESS recognize when facts in a fact-file are changing (example)? Thanks for advance, Tanja -- Dipl.-Ing. Vicovac Tanja Forschungsgruppe Ingenieurgeodäsie Institut für Geodäsie und Geophysik Technische Universität Wien Gußhausstraße 27-29 / E128-3 A-1040 Wien E-mail: tanja.vico...@tuwien.ac.at Web: http://info.tuwien.ac.at/ingeo Tel.: (+43)-(0)1-58801-12844 Fax: (+43)-(0)1-58801-12894 To unsubscribe, send the words 'unsubscribe jess-users y...@address.com' in the BODY of a message to majord...@sandia.gov, NOT to the list (use your own address!) List problems? Notify owner-jess-us...@sandia.gov To unsubscribe, send the words 'unsubscribe jess-users y...@address.com' in the BODY of a message to majord...@sandia.gov, NOT to the list (use your own address!) List problems? Notify owner-jess-us...@sandia.gov.
Re: JESS: changing facts in a fact file
On Wed, Mar 11, 2009 at 3:30 PM, Tanja Vicovac tanja.vico...@tuwien.ac.atwrote: Hi, I have to create a KBS with a fact-file, which is extended every 10 minutes. I think it's possible to check in a certain intervall if the facts-file is changing or not (like polling), but is there another possibility? That's what the UNIX utility tail (option -f) does, so I guess there isn't a better way ;-) You may find its C code when you google for tail.c. How does JESS recognize when facts in a fact-file are changing (example)? Jess expects the facts to be inserted/added to its working memory. I you have facts saved or assembled on a file, you have to call (load-facts ...) to add all the facts from this file at some appropriate time. -W Thanks for advance, Tanja -- Dipl.-Ing. Vicovac Tanja Forschungsgruppe Ingenieurgeodäsie Institut für Geodäsie und Geophysik Technische Universität Wien Gußhausstraße 27-29 / E128-3 A-1040 Wien E-mail: tanja.vico...@tuwien.ac.at Web: http://info.tuwien.ac.at/ingeo Tel.: (+43)-(0)1-58801-12844 Fax: (+43)-(0)1-58801-12894 To unsubscribe, send the words 'unsubscribe jess-users y...@address.com' in the BODY of a message to majord...@sandia.gov, NOT to the list (use your own address!) List problems? Notify owner-jess-us...@sandia.gov
Re: JESS: changing facts in a fact file
Hi Tanja, There is also an API called JNotify that allows one to receive file system events on Windows and LINUX. See: http://nixbit.com/cat/programming/libraries/jnotify/ http://sourceforge.net/projects/jnotify/ See if this is what you need. You can also have a thread periodically monitor your file system. Cheers, Jason On Wed, Mar 11, 2009 at 10:30 AM, Tanja Vicovac tanja.vico...@tuwien.ac.atwrote: Hi, I have to create a KBS with a fact-file, which is extended every 10 minutes. I think it's possible to check in a certain intervall if the facts-file is changing or not (like polling), but is there another possibility? How does JESS recognize when facts in a fact-file are changing (example)? Thanks for advance, Tanja -- Dipl.-Ing. Vicovac Tanja Forschungsgruppe Ingenieurgeodäsie Institut für Geodäsie und Geophysik Technische Universität Wien Gußhausstraße 27-29 / E128-3 A-1040 Wien E-mail: tanja.vico...@tuwien.ac.at Web: http://info.tuwien.ac.at/ingeo Tel.: (+43)-(0)1-58801-12844 Fax: (+43)-(0)1-58801-12894 To unsubscribe, send the words 'unsubscribe jess-users y...@address.com' in the BODY of a message to majord...@sandia.gov, NOT to the list (use your own address!) List problems? Notify owner-jess-us...@sandia.gov
Re: JESS: changing facts in a fact file
Instead of modifying the existing file, why not create a new file? that way you can just load each new file at the set interval? the other approach I've used in the past is to sent facts to JESS using JMS messaging peter On Wed, Mar 11, 2009 at 1:00 PM, Jason Morris jason.c.mor...@gmail.com wrote: Hi Tanja, There is also an API called JNotify that allows one to receive file system events on Windows and LINUX. See: http://nixbit.com/cat/programming/libraries/jnotify/ http://sourceforge.net/projects/jnotify/ See if this is what you need. You can also have a thread periodically monitor your file system. Cheers, Jason On Wed, Mar 11, 2009 at 10:30 AM, Tanja Vicovac tanja.vico...@tuwien.ac.atwrote: Hi, I have to create a KBS with a fact-file, which is extended every 10 minutes. I think it's possible to check in a certain intervall if the facts-file is changing or not (like polling), but is there another possibility? How does JESS recognize when facts in a fact-file are changing (example)? Thanks for advance, Tanja -- Dipl.-Ing. Vicovac Tanja Forschungsgruppe Ingenieurgeodäsie Institut für Geodäsie und Geophysik Technische Universität Wien Gußhausstraße 27-29 / E128-3 A-1040 Wien E-mail: tanja.vico...@tuwien.ac.at Web: http://info.tuwien.ac.at/ingeo Tel.: (+43)-(0)1-58801-12844 Fax: (+43)-(0)1-58801-12894 To unsubscribe, send the words 'unsubscribe jess-users y...@address.com' in the BODY of a message to majord...@sandia.gov, NOT to the list (use your own address!) List problems? Notify owner-jess-us...@sandia.gov To unsubscribe, send the words 'unsubscribe jess-users y...@address.com' in the BODY of a message to majord...@sandia.gov, NOT to the list (use your own address!) List problems? Notify owner-jess-us...@sandia.gov.