@Override public int addBooleanVariable(double arg0) { isSolved = false; hasUpdate = true; numVariables++; return baseSolver.addBooleanVariable(arg0); }
public boolean getBooleanValue(int arg0) { return baseSolver.getBooleanValue(arg0); }
private void addConstraint(ILPConstraint c) { if (c.sense == GRB.EQUAL) baseSolver.addEqualityConstraint(c.vars, c.coeffs, c.rhs); else if (c.sense == GRB.GREATER_EQUAL) baseSolver.addGreaterThanConstraint(c.vars, c.coeffs, c.rhs); else if (c.sense == GRB.LESS_EQUAL) baseSolver.addLessThanConstraint(c.vars, c.coeffs, c.rhs); else assert false : c.sense; }
if (tautology || solver.isSolved()) return; solver.setMaximize(true); constraint.consolidateVariables(variables); indexMap = new HashMap(); for (int idx = 0; idx < scores.length; idx++) weights[idx] = scores[idx].score; int[] indexes = solver.addDiscreteVariable(weights); } else { System.err.println("ILP ERROR: Unsatisfiable constraints!"); solver.addEqualityConstraint(new int[] {0}, new double[] {1}, 2); if (!solver.solve()) throw new InferenceNotOptimalException(solver, head); int variableIndex = 0; Score[] scores = v.getScores().toArray(); for (int j = 0; j < scores.length; ++j, ++variableIndex) if (solver.getBooleanValue(variableIndex)) { v.setValue(scores[j].value);
xmp.setMaximize(true); boolean solved = xmp.solve();
solver.addGreaterThanConstraint(indexes, coefficients, bound); else { String[] stringIndexes = new String[children.length]; solver.addGreaterThanConstraint(indexes, coefficients, bound); solver.addLessThanConstraint(indexes, coefficients, bound + c.getM() - 1);
public void addEqualityConstraint(int[] arg0, double[] arg1, double arg2) { this.baseSolver.addEqualityConstraint(arg0, arg1, arg2); isSolved = false; }
public void addGreaterThanConstraint(int[] arg0, double[] arg1, double arg2) { this.baseSolver.addGreaterThanConstraint(arg0, arg1, arg2); isSolved = false; }
public void addLessThanConstraint(int[] arg0, double[] arg1, double arg2) { this.baseSolver.addLessThanConstraint(arg0, arg1, arg2); isSolved = false; }
public void setMaximize(boolean arg0) { baseSolver.setMaximize(arg0); }
public void solve() throws Exception { solver.solve(); }
public void write(StringBuffer arg0) { baseSolver.write(arg0); } }
public void reset() { baseSolver.reset(); this.cuttingPlaneConstraints.clear(); this.isSolved = false; this.hasUpdate = false; this.timedOut = false; }
@Override public int[] addDiscreteVariable(double[] arg0) { isSolved = false; hasUpdate = true; numVariables += arg0.length; return baseSolver.addDiscreteVariable(arg0); }
xmp.setMaximize(true); boolean solved = xmp.solve();
solver.addGreaterThanConstraint(indexes, coefficients, bound); return; solver.addGreaterThanConstraint(indexes, coefficients, bound); else { String[] stringIndexes = new String[children.length]; solver.addGreaterThanConstraint(indexes, coefficients, bound); solver.addLessThanConstraint(indexes, coefficients, bound);
public void addEqualityConstraint(int[] arg0, double[] arg1, double arg2) { this.baseSolver.addEqualityConstraint(arg0, arg1, arg2); isSolved = false; }
public void addGreaterThanConstraint(int[] arg0, double[] arg1, double arg2) { this.baseSolver.addGreaterThanConstraint(arg0, arg1, arg2); isSolved = false; }
public void addLessThanConstraint(int[] arg0, double[] arg1, double arg2) { this.baseSolver.addLessThanConstraint(arg0, arg1, arg2); isSolved = false; }
public void setMaximize(boolean maximize) { this.solver.setMaximize(maximize); }