Created
February 12, 2018 22:27
-
-
Save htrajan/52ca0f62fa882eafdd08bfd985d0ecfa to your computer and use it in GitHub Desktop.
Binary Home Searching
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Inject BinarySearchSolver solver; | |
| ... | |
| Function<Double, Affordability> affordabilityFn ...; // our mapping function that takes a number and returns an affordability | |
| Function<Affordability, Boolean> manageableTargetTest = affordability -> affordability.getOrdinal() <= MANAGEABLE.getOrdinal(); | |
| double maxManageablePrice = solver.solveForMaxValuePassingTargetTest( | |
| lowerBound, | |
| upperBound, | |
| tolerance, // how close our upper and lower bounds should be to stop searching | |
| affordabilityFn, | |
| manageableTargetTest, | |
| maxSearchIterations); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment