Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
public final class World {
private final FactSet facts;
private final RuleSet rules;
private int iterations;

public void addFact(final Origin origin, final Fact fact) {
this.facts.add(origin, fact);
Expand Down Expand Up @@ -66,6 +67,7 @@ public void run(RunLimits limits, StepBudget steps, final SymbolTable symbolTabl
this.facts.merge(newFacts);

if (this.facts.size() == len) {
this.iterations += iterations;
return;
}

Expand All @@ -84,6 +86,10 @@ public FactSet getFacts() {
return this.facts;
}

public int iterations() {
return this.iterations;
}

public RuleSet getRules() {
return this.rules;
}
Expand Down Expand Up @@ -144,6 +150,7 @@ public World(FactSet facts, RuleSet rules) {
public World(World w) {
this.facts = w.facts.clone();
this.rules = w.rules.clone();
this.iterations = w.iterations;
}

public String print(SymbolTable symbolTable) {
Expand Down
Loading