buguroo / pyknow

PyKnow: Expert Systems for Python
GNU Lesser General Public License v3.0
470 stars 141 forks source link

Thank you so much! #54

Open shahintaj196 opened 4 years ago

shahintaj196 commented 4 years ago

Thank you so much! This completely fixed my problem. My initialization time went from 12 minutes to 1 second, and my reset time also went from 12 minutes to 1 second. The time to run the engine, declare facts, and reset the engine after it has been run once have all improved from approximately 30 seconds to near instantaneous. Thank you again and have a nice day!

Originally posted by @ab612 in https://github.com/buguroo/pyknow/issues/7#issuecomment-369648384

shahintaj196 commented 4 years ago

hello.I want to mesure policy proccessing time in my code? what shoud i do? for example in below code how obtain policy(rule) procceing time?

class animal(Fact): pass class age_animal(KnowledgeEngine): @rule(animal(age='1')) def f1(self): print("young")

class P(KnowledgeEngine): @rule(animal(age='7)) def f2(self): print("old")

engine = age_animal() engine.reset() engine.declare(animal(age=input("Enter age value:\n") )) engine.run(