fiveham / Sudoku_Solver

Solve sudoku puzzles by representing the puzzle as a bipartite graph of truth-claims about cells' values and rule-statements that have exactly one true neighbor and removing edges as information is added
MIT License
0 stars 0 forks source link

Child Times should add themselves as children of their parent during construction #10

Closed fiveham closed 8 years ago

fiveham commented 8 years ago

This will enable the structure of a FalsifiedTime time tree to be discerned while the time tree is being built.

Calls such as

time.addChild(new SolveEventSledgehammer(time, ...).falsify());

would become

new SolveEventSledgehammer(time, ...).falsify();,

and time would know that this new SolveEventSledgehammer is among its children before the new Time has set its falsified Claims false.

Currently, the call to falsify() occurs entirely before the child Time is added as a child; as such, all the children of that child are constructed, similarly disconnected from the new child Time, before the nth grandchildren add the n+1th grandchildren as children, and so forth up the tree toward the root. That's a very unintuitive way to build a time tree; so, for the sake of clarity, bidirectionality of parent-child relationships should be enforced at the time when the child is constructed.