SimplexSolver extends LinearOptimizer { public SimplexSolver() { this(DEFAULT_EPSILON, DEFAULT_ULPS, DEFAULT_CUT_OFF); } SimplexSolver();  SimplexSolver(final double epsilon);  SimplexSolver(final double epsilon, final int maxUlps);  SimplexSolver(final double epsilon, final int maxUlps, final double cutOff); @Override PointValuePair optimize(OptimizationData... optData); @Override PointValuePair doOptimize();  }
@Test public void testSimplexSolver() { LinearObjectiveFunction f = new LinearObjectiveFunction(new double[] { 15, 10 }, 7); Collection<LinearConstraint> constraints = new ArrayList<LinearConstraint>(); constraints.add(new LinearConstraint(new double[] { 1, 0 }, Relationship.LEQ, 2)); constraints.add(new LinearConstraint(new double[] { 0, 1 }, Relationship.LEQ, 3)); constraints.add(new LinearConstraint(new double[] { 1, 1 }, Relationship.EQ, 4)); SimplexSolver solver = new SimplexSolver(); PointValuePair solution = solver.optimize(DEFAULT_MAX_ITER, f, new LinearConstraintSet(constraints), GoalType.MAXIMIZE, new NonNegativeConstraint(true)); Assert.assertEquals(2.0, solution.getPoint()[0], 0.0); Assert.assertEquals(2.0, solution.getPoint()[1], 0.0); Assert.assertEquals(57.0, solution.getValue(), 0.0); }