Commit 0238560b authored by Jonathan Shahen's avatar Jonathan Shahen
Browse files

Added controllable MIP relative Tolerance for the CPLX ILP Solver

parent da0b63f8
......@@ -69,8 +69,8 @@ public class ReduceToILP implements ReduceTo {
IloOplModelSource modelSource = oplF.createOplModelSource(settings.dataFolder + "/ilp.mod");
/*TIMING*/timing.stopTimer("ReduceToILP::reduce::readOPL");
IloOplSettings settings = oplF.createOplSettings(errHandler);
IloOplModelDefinition def = oplF.createOplModelDefinition(modelSource, settings);
IloOplSettings oplSettings = oplF.createOplSettings(errHandler);
IloOplModelDefinition def = oplF.createOplModelDefinition(modelSource, oplSettings);
cplex = oplF.createCplex();
if (!logger.isLoggable(Level.FINE)) {
......@@ -91,6 +91,9 @@ public class ReduceToILP implements ReduceTo {
opl.generate();
/*TIMING*/timing.stopTimer("ReduceToILP::reduce::generate");
// Set the optimization parameters
opl.getCplex().setParam(IloCplex.Param.MIP.Tolerances.MIPGap, settings.relativeMIPGapTolerance);
/*TIMING*/timing.stopTimer("ReduceToILP::reduce");
return true;
}
......
......@@ -153,6 +153,12 @@ public class VagabondSettings {
*/
public Integer equalSpreadNum = 0;
/**
* The relative MIP Gap Tolerance to set CPLEX to; the default value in CPLEX is 1e-4.
* @vagabond.category ILP Optimization Parameter
*/
public double relativeMIPGapTolerance = .1;
/**
* Prevents programmers from creating their own settings, there must be only one copy of this.
* @see #getInstance()
......@@ -181,13 +187,20 @@ public class VagabondSettings {
s.append("numberOfEpochs=" + numberOfEpochs + ", ");
s.append("slidingWindow=" + slidingWindow + ", ");
s.append("migrationBudget=" + migrationBudget + ", ");
s.append("settingsFile=" + settingsFile);
switch (reductionAlgorithm) {
case REDUCTION_ILP:
s.append("relativeMIPGapTolerance=" + relativeMIPGapTolerance + ", ");
break;
default:
}
switch (placementAlgorithm) {
case PLACEMENT_FILE:
s.append("placementMapFile=" + placementMapFile + ", ");
break;
case PLACEMENT_EQUALSPREAD:
case PLACEMENT_EQUALSPREADHALF:
s.append("equalSpreadNum=" + equalSpreadNum + ", ");
break;
default:
......@@ -201,6 +214,8 @@ public class VagabondSettings {
break;
}
s.append("settingsFile=" + settingsFile + ", ");
s.append("}");
return s.toString();
......@@ -285,7 +300,7 @@ public class VagabondSettings {
}
/**
* Descriptive function to return the file path of the timing file. Used to write out the timing results.
* Function to return the file path of the timing file. Used to write out the timing results.
* This should be considered a WRITE only file.
* @return File object to the timing file; might not be created yet.
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment