Examples of ObjectiveFunction


Examples of org.apache.commons.math3.optim.nonlinear.scalar.ObjectiveFunction

                }
            }, new double[] { 2.0, -3.0 });
        SimplexOptimizer optimizer = new SimplexOptimizer(-1, 1e-6);
        PointValuePair optimum =
            optimizer.optimize(new MaxEval(200),
                               new ObjectiveFunction(ls),
                               GoalType.MINIMIZE,
                               new InitialGuess(new double[] { 10, 10 }),
                               new NelderMeadSimplex(2));
        Assert.assertEquals( 2, optimum.getPointRef()[0], 3e-5);
        Assert.assertEquals(-3, optimum.getPointRef()[1], 4e-4);
View Full Code Here

Examples of org.sat4j.pb.ObjectiveFunction

      IVec<BigInteger> coefficients = new Vec<BigInteger>(colors);
      for (int k = 1; k <= colors; k++) {
        literals.push(numberOfVertices * colors + k);
        coefficients.push(BigInteger.ONE);
      }
      ObjectiveFunction objFunc = new ObjectiveFunction(literals,
          coefficients);
      solver.setObjectiveFunction(objFunc);

      /* Solve */
      IOptimizationProblem op = (IOptimizationProblem) solver;
View Full Code Here

Examples of rinde.sim.pdptw.common.ObjectiveFunction

        .add(ImmutableList.<ParcelDTO> of(a, b, c, c, b))
        .add(ImmutableList.<ParcelDTO> of(d, d))
        .build();

    final StatisticsDTO stats = Solvers.computeStats(state, routes);
    final ObjectiveFunction objFunc = new Gendreau06ObjectiveFunction();
    final double cost = objFunc.computeCost(stats);

    final double cost0 = objFunc.computeCost(Solvers.computeStats(
        state.withSingleVehicle(0),
        ImmutableList.of(routes.get(0))));
    final double cost1 = objFunc.computeCost(Solvers.computeStats(
        state.withSingleVehicle(1),
        ImmutableList.of(routes.get(1))));
    assertEquals(cost, cost0 + cost1, 0.001);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.