Skip to content
Snippets Groups Projects
Commit 07114541 authored by Paul A. Rubin's avatar Paul A. Rubin
Browse files

Made emphasis values static parameters.

parent 9827900d
No related branches found
No related tags found
No related merge requests found
...@@ -18,6 +18,7 @@ import xmtrclusters.Problem; ...@@ -18,6 +18,7 @@ import xmtrclusters.Problem;
*/ */
public final class MIPModel { public final class MIPModel {
private static final double HALF = 0.5; // for rounding binary values private static final double HALF = 0.5; // for rounding binary values
private static final int BESTBOUND = 3; // emphasizes improving best bound
private final Problem problem; // the parent problem private final Problem problem; // the parent problem
...@@ -184,7 +185,7 @@ public final class MIPModel { ...@@ -184,7 +185,7 @@ public final class MIPModel {
*/ */
public double solve(final double sec) throws IloException { public double solve(final double sec) throws IloException {
mip.setParam(IloCplex.DoubleParam.TimeLimit, sec); mip.setParam(IloCplex.DoubleParam.TimeLimit, sec);
mip.setParam(IloCplex.Param.Emphasis.MIP, 3); mip.setParam(IloCplex.Param.Emphasis.MIP, BESTBOUND);
mip.solve(); mip.solve();
return mip.getObjValue(); return mip.getObjValue();
} }
......
...@@ -24,7 +24,8 @@ import xmtrclusters.Problem; ...@@ -24,7 +24,8 @@ import xmtrclusters.Problem;
* @author Paul A. Rubin (rubin@msu.edu) * @author Paul A. Rubin (rubin@msu.edu)
*/ */
public final class MIPModel2 { public final class MIPModel2 {
private static final double HALF = 0.5; // for rounding binary values private static final double HALF = 0.5; // for rounding binary values
private static final int OPTIMALITY = 2; // emphasizes optimality
private final Problem problem; // the parent problem private final Problem problem; // the parent problem
...@@ -171,7 +172,7 @@ public final class MIPModel2 { ...@@ -171,7 +172,7 @@ public final class MIPModel2 {
*/ */
public double solve(final double sec) throws IloException { public double solve(final double sec) throws IloException {
mip.setParam(IloCplex.DoubleParam.TimeLimit, sec); mip.setParam(IloCplex.DoubleParam.TimeLimit, sec);
mip.setParam(IloCplex.Param.Emphasis.MIP, 2); mip.setParam(IloCplex.Param.Emphasis.MIP, OPTIMALITY);
mip.solve(); mip.solve();
return mip.getObjValue(); return mip.getObjValue();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment