Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @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);
Add Comment
Please, Sign In to add comment