class School::Domain
- School::Domain
- Reference
- Object
Overview
A domain is a collection of facts.
Defined in:
school/domain/builder.crschool/domain/domain.cr
Constructors
-
.new
Instantiates a new, empty domain.
Instance Method Summary
-
#add(rule : Rule) : Rule
Adds a rule to the domain.
-
#assert(fact : Fact) : Fact
Adds a fact to the domain.
-
#facts
Returns the facts in the domain.
-
#remove(rule : Rule) : Rule
Removes a rule from the domain.
-
#retract(fact : Fact) : Fact
Removes a fact from the domain.
-
#rules
Returns the rules in the domain.
-
#run
Runs the rules engine.
Constructor Detail
Instance Method Detail
def run
#
Runs the rules engine.
First, matches rules' conditions to facts, and then invokes rules' actions for each distinct match.
Rules are matched in order of their definition. Within a run, earlier rules can influence later rules (by asserting or retracting facts). Later rules cannot influence earlier rules.