help!! is there a message mechanism in CLIPS

green glar
  • green glar

    green glar - 2009-08-29

    hi all,
         I wnat to know if there is a message mechanism in CLIPS. I want to use CLIPS in a  processor-sensors model:
       take CLIPS engine as the processor and C/C++ functions as sensors: sensors assert facts into the engine, engine reasons.
         my question is, when should a sensor assert a fact into the engine? that to say, how does a sensor know the a engine is busy? is there a message mechanism to inform sensor in the engine " you can input new facts now"

    • Gary Riley

      Gary Riley - 2009-09-05

      Assertions from external sources have to occur between rule firings. So if you have CLIPS embedded, you could fire one rule at a time and after each firing, have your sensors assert any new facts. Alternately you could use the AddRunFunction API call to register a function that's called after each rule execution and just let CLIPS run. Either of these approaches would require  polling the sensors. If you don't want to poll the sensors and have them determine when to assert new facts, you'd create a queue where each sensor could add new facts to be asserted (probably with a locking mechanism to avoid concurrent access). You'd then use one of the prior methods to examine the queue at each rule firing boundary and add any new facts.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks