public void addLessThanConstraint(int[] arg0, double[] arg1, double arg2) { addConstraint(arg0, arg1, arg2, ILPConstraint.LESS_THAN); }
public BeamSearch(int beamSize) { this.beamSize = beamSize; this.maximize = false; reset(); }
List<PartialAssignment> nextQ = expandState(initState); nextQ.addAll(expandState(a)); beam.addAll(nextQ); beam = sortAndResize(beam); runUnconstrainedSearch();
private List<PartialAssignment> sortAndResize(List<PartialAssignment> pq) { sortBeam(pq); if (beamSize < 0) return pq; if (pq.size() <= beamSize) return pq; List<PartialAssignment> pq1 = new ArrayList<PartialAssignment>(); for (int i = 0; i < beamSize; i++) { pq1.add(pq.get(i)); } return pq1; }
public ILPSolver getSolver() { switch (type) { case Beam: return new BeamSearch(beamSize); case Gurobi: return new GurobiHook(); case OJAlgo: return new OJalgoHook(); case JLISCuttingPlaneGurobi: return new JLISCuttingPlaneILPSolverGurobi(new GurobiHook()); } throw new RuntimeException(); } }
boolean constraintsSatisfied = checkConstraints(aTrue); System.out.println("Checking state: " + aFalse); constraintsSatisfied = checkConstraints(aFalse); System.out.println("Checking state: " + newState); boolean constraintsSatisfied = checkConstraints(newState);
List<PartialAssignment> nextQ = expandState(initState); nextQ.addAll(expandState(a)); beam.addAll(nextQ); beam = sortAndResize(beam); runUnconstrainedSearch();
private List<PartialAssignment> sortAndResize(List<PartialAssignment> pq) { sortBeam(pq); if (beamSize < 0) return pq; if (pq.size() <= beamSize) return pq; List<PartialAssignment> pq1 = new ArrayList<PartialAssignment>(); for (int i = 0; i < beamSize; i++) { pq1.add(pq.get(i)); } return pq1; }
public ILPSolver getSolver() { switch (type) { case Beam: return new BeamSearch(beamSize); case Gurobi: return new GurobiHook(); case OJAlgo: return new OJalgoHook(); case JLISCuttingPlaneGurobi: return new JLISCuttingPlaneILPSolverGurobi(new GurobiHook()); } throw new RuntimeException(); } }
boolean constraintsSatisfied = checkConstraints(aTrue); System.out.println("Checking state: " + aFalse); constraintsSatisfied = checkConstraints(aFalse); System.out.println("Checking state: " + newState); boolean constraintsSatisfied = checkConstraints(newState);
public void addEqualityConstraint(int[] arg0, double[] arg1, double arg2) { addConstraint(arg0, arg1, arg2, ILPConstraint.EQUAL); }
public BeamSearch(int beamSize) { this.beamSize = beamSize; this.maximize = false; reset(); }
public void addGreaterThanConstraint(int[] arg0, double[] arg1, double arg2) { addConstraint(arg0, arg1, arg2, ILPConstraint.GREATER_THAN); }
public void addEqualityConstraint(int[] arg0, double[] arg1, double arg2) { addConstraint(arg0, arg1, arg2, ILPConstraint.EQUAL); }
public void addGreaterThanConstraint(int[] arg0, double[] arg1, double arg2) { addConstraint(arg0, arg1, arg2, ILPConstraint.GREATER_THAN); }
public void addLessThanConstraint(int[] arg0, double[] arg1, double arg2) { addConstraint(arg0, arg1, arg2, ILPConstraint.LESS_THAN); }