You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The last activation on the Greetings example from the docs is not executed. So, when ask_name is executed, ask_location is not and vice-versa. Therefore, greet is never executed. I saw that you had a similar issue (#7 ) that is supposedly fixed, but I think this might be a similar thing.
I noticed that if salience is set, then this just works fine. When not set, the Activations' keys are the same and that's why the second activation is removed from the list when _update_agenda is called after the first activation is fired.
I'm currently using the latest code of the develop branch. This is the Greeting code I'm using:
from experta import *
class Greetings(KnowledgeEngine):
@DefFacts()
def _initial_action(self):
yield Fact(action="greet")
@Rule(Fact(action='greet'),
NOT(Fact(name=W())))
def ask_name(self):
self.declare(Fact(name=input("What's your name? ")))
@Rule(Fact(action='greet'),
NOT(Fact(location=W())))
def ask_location(self):
self.declare(Fact(location=input("Where are you? ")))
@Rule(Fact(action='greet'),
Fact(name=MATCH.name),
Fact(location=MATCH.location))
def greet(self, name, location):
print("Hi %s! How is the weather in %s?" % (name, location))
engine = Greetings()
engine.reset() # Prepare the engine for the execution.
engine.run() # Run it!
The text was updated successfully, but these errors were encountered:
The last activation on the Greetings example from the docs is not executed. So, when ask_name is executed, ask_location is not and vice-versa. Therefore, greet is never executed. I saw that you had a similar issue (#7 ) that is supposedly fixed, but I think this might be a similar thing.
I noticed that if salience is set, then this just works fine. When not set, the Activations' keys are the same and that's why the second activation is removed from the list when _update_agenda is called after the first activation is fired.
I'm currently using the latest code of the develop branch. This is the Greeting code I'm using:
The text was updated successfully, but these errors were encountered: