Skip to content
Nateowami edited this page Aug 13, 2015 · 8 revisions

I'll do my best to explain how the solver is supposed to work. You can find all solver classes in com.github.nateowami.solve4x.solver. The Solver class does coordinating of the solving. I think most of us know computers aren't very smart, and even solving an equation myself it's often hard to tell which way to go when there's a fork in the road. Therefore, the Solver class has the difficult job of taking every fork. OK, not every fork. When it's possible to go one way or another, the solving algorithm (each one is its own class) will tell the solver approximately how "smart" it would be to use that algorithm. For example, in the expression 4x+5x+35x+2xy it would report that it's "really smart" to combine the like terms (the first three terms). "Smartness" is represented by a number from from 0-9. Nine is the smartest; and the example above should say the "smartness level" is about seven or eight. Predicting smartness will get really complicated when things like the quadratic formula come into play, so if unsure it will go both ways when at a fork in the road. The solving algorithm also needs to report and explanation of the action it's taking so it can be explained to the user. The Solver's ArrayList of solutions (which are basically just lists of steps) will keep growing longer as it goes. It will iterate through each one trying to find an acceptable solving algorithm(s) for it. And that will be another fork in the road. When it finds that one of the equations is solved, it's done. Eventually it should learn to finish even if it can't be fully solved.

Clone this wiki locally