Commit ee9073f4 authored by Rubin, Paul's avatar Rubin, Paul

Tweaked output format a little.

parent e0dfaa96
......@@ -53,9 +53,9 @@ public final class L1 extends Model {
* @throws IloException if there is no final solution
*/
public String evaluate() throws IloException {
return String.format("%nL1 norm of the final solution = %5.2e%n",
return String.format("%nL1 norm of the final solution = %7.4e%n",
mip.getValue(l1))
+ String.format("L2 norm of the final solution = %5.2e%n",
+ String.format("L2 norm of the final solution = %7.4e%n",
Math.sqrt(mip.getValue(l2)));
}
......@@ -71,12 +71,10 @@ public final class L1 extends Model {
*/
@Override
protected void main() throws IloException {
String report =
String.format("%nNew incumbent with L1 norm = %5.2e"
+ " and L2 norm %5.2e%n",
getValue(l1), Math.sqrt(getValue(l2)));
System.out.println(report);
System.out.println(String.format("%nNew incumbent with L1 norm = %7.4e"
+ " and L2 norm %7.4e%n",
getValue(l1), Math.sqrt(getValue(l2))));
}
}
}
......@@ -23,7 +23,7 @@ public abstract class Model {
protected final int bpp; // bins per pallet limit
protected final double totalLoad; // total load
protected final double[] size; // bin sizes
protected final IloNumVar[] y; // deviation variables (some models only)
protected final IloNumVar[] y; // deviation variables
/**
* Constructor.
......
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