我正在使用org.apache.commons.math3.optimization
专门与SimplexSolver
合作,我正在获得UnboundedSolutionException
。问题是我不知道这意味着什么或怎么做。
以下是输入:
double[] cliScores = new double[] {-0.6249277001180347};
LinearObjectiveFunction f = new LinearObjectiveFunction(cliScores,0.0);
Collection constraints = new ArrayList();
constraints.add(new LinearConstraint(new double[]{1}, Relationship.LEQ, 769.3635211267606));
constraints.add(new LinearConstraint(new double[]{1}, Relationship.LEQ, 3.2466463287069885E-28));
PointValuePair solution = new SimplexSolver().optimize(f, constraints, GoalType.MAXIMIZE, false);
解决方案部分的所有内容看起来都是正确的...至少它与预期的输入匹配。