Skip to content

Commit

Permalink
Move addConstraint to planner
Browse files Browse the repository at this point in the history
  • Loading branch information
voltrevo committed Jun 28, 2023
1 parent 1b32302 commit 26f1c47
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions inputs/failing/octane/deltablue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,6 @@ abstract class Constraint {
abstract recalculate(): void;
abstract inputsKnown(mark: number): boolean;

/**
* Activate this constraint and attempt to satisfy it.
*/
addConstraint(planner: Planner, _c?: Constraint) {
this.addToGraph();
planner.incrementalAdd(this);
}

/**
* Attempt to find a way to enforce this constraint. If successful,
* record the solution, perhaps modifying the current dataflow
Expand Down Expand Up @@ -805,7 +797,7 @@ class Planner {

change(v: Variable, newValue: number) {
let edit = new EditConstraint(v, Strength.PREFERRED);
edit.addConstraint(this);
this.addConstraint(edit);
let edits = new OrderedCollection<Constraint>();
edits.add(edit);
let plan = this.extractPlanFromConstraints(edits);
Expand All @@ -816,8 +808,12 @@ class Planner {
edit.destroyConstraint(this);
}

/**
* Activate this constraint and attempt to satisfy it.
*/
addConstraint(c: Constraint) {
c.addConstraint(this);
c.addToGraph();
this.incrementalAdd(c);
}
}

Expand Down Expand Up @@ -951,3 +947,5 @@ export function deltaBlue() {
chainTest(100);
projectionTest(100);
}

deltaBlue();

0 comments on commit 26f1c47

Please sign in to comment.