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
I have a rule file below based on one of your examples. Originally I started out playing with salience (took me a short while to figure out the syntax in the DSL to set the salience since their weren't an examples). Anyway, in the example below the "count3" rule does not fire ever. I can if I start setting salience, but, even then it seems nonsensical at times. The "count2" rule that modifies the Counter seems to win always. I would assume that all the rules would fire. Thanks.
I have a rule file below based on one of your examples. Originally I started out playing with salience (took me a short while to figure out the syntax in the DSL to set the salience since their weren't an examples). Anyway, in the example below the "count3" rule does not fire ever. I can if I start setting salience, but, even then it seems nonsensical at times. The "count2" rule that modifies the Counter seems to win always. I would assume that all the rules would fire. Thanks.
define Counter {
count: 0,
constructor: function(count){
this.count = count;
}
}
rule "counted too high" {
when {
ctr: Counter ctr.count == 100;
}
then{
console.log("Look ma! I counted to " + ctr.count);
halt();
}
}
rule "not count" {
when {
not(ctr: Counter);
}
then{
console.log("Imma gonna count!");
assert(new Counter(1));
}
}
rule count1 {
when{
ctr: Counter {count: count}
}
then{
console.log("Count 1");
}
}
rule count2 {
}
rule count3 {
}
The text was updated successfully, but these errors were encountered: