(predicate: Predicate$1, action: Action, salience?: number)
=> void Adds a rule which runs an action if its predicate evaluates to true.
param predicate- Predicate to evaluate. A function taking the system as parameter.
param action- Action to execute. A function taking the system as parameter.
param salience- Priority of the rule.
(predicate: Predicate$1, fact: string, grade?: number, salience?: number)
=> void Add a rule which asserts a fact if its predicate evaluates to true.
param predicate- Predicate to evaluate. A function taking the system as parameter.
param fact- The fact to assert.
param grade- The optional grade to use when asserting the fact.
param salience- Priority of the rule.
(predicate: Predicate$1, fact: string, grade?: number, salience?: number)
=> void Add a rule which retracts a fact if its predicate evaluates to true.
param predicate- Predicate to evaluate. A function taking the system as parameter.
param fact- The fact to retract.
param grade- The optional grade to use when retracting the fact.
param salience- Priority of the rule.
(rule: Rule)
=> void Add a custom rule.
param rule- The rule to add.
()
=> void Executes all rules for which the predicate evaluates to true.
(fact: string, grade?: number)
=> void Asserts a fact.
param fact- The fact to assert.
param grade- The optional grade to use.
(fact: string, grade?: number)
=> void Retracts a fact.
param fact- The fact to retract.
param grade- The optional grade to use.
(fact: string)
=> number Returns the grade for the specified fact.
param fact- The fact to obtain the grade from.
returns The grade for the fact.
(facts: string[])
=> number Returns the minimum grade for the specified facts.
param facts- The facts to obtain the minimum grade from.
returns The minimum grade for the facts.
(facts: string[])
=> number Returns the maximum grade for the specified facts.
param facts- The facts to obtain the maximum grade from.
returns The maximum grade for the facts.