Commit a02b4e28 authored by Daniel Le Berre's avatar Daniel Le Berre

Fixed handling of Interrupted Exception with

Thread.currentThread().interrupt().
parent 10ff826f
......@@ -360,6 +360,7 @@ public class ManyCore<S extends ISolver>
} while (this.remainingSolvers.get() > 0);
} catch (InterruptedException e) {
// will happen when one solver found a solution
Thread.currentThread().interrupt();
}
if (!this.solved) {
assert this.remainingSolvers.get() == 0;
......
......@@ -58,7 +58,7 @@ public abstract class AbstractLinMultiObjOptimizer extends PseudoOptDecorator
private static final long serialVersionUID = 1L;
protected final List<ObjectiveFunction> objs = new ArrayList<ObjectiveFunction>();
protected final transient List<ObjectiveFunction> objs = new ArrayList<ObjectiveFunction>();
protected boolean initConstraintsSet = false;
......@@ -106,9 +106,9 @@ public abstract class AbstractLinMultiObjOptimizer extends PseudoOptDecorator
}
boolean res = super.admitABetterSolution(assumps);
if (res && isVerbose()) {
System.out.println(getLogPrefix()
+ "Current objective functions values: "
+ Arrays.toString(getObjectiveValues()));
System.out.println(
getLogPrefix() + "Current objective functions values: "
+ Arrays.toString(getObjectiveValues()));
}
return res;
}
......
......@@ -96,7 +96,7 @@ public class CriterionOptimumComputer<S extends IPBSolver> {
try {
this.lock.acquire();
} catch (InterruptedException e) {
throw new RuntimeException(e);
Thread.currentThread().interrupt();
}
}
}
......@@ -127,12 +127,17 @@ public class CriterionOptimumComputer<S extends IPBSolver> {
try {
this.lock.acquire(this.objs.size());
} catch (InterruptedException e) {
throw new RuntimeException(e);
Thread.currentThread().interrupt();
}
}
class OptimumValueWriter implements SolutionFoundListener {
/**
*
*/
private static final long serialVersionUID = 1L;
private final CriterionOptimumComputer<S> coc;
private final int solverIndex;
......
......@@ -225,6 +225,7 @@ public class RemoteControlStrategy implements RestartStrategy,
Thread.sleep(SLEEP_TIME);
} catch (InterruptedException e) {
logger.log(e.getMessage());
Thread.currentThread().interrupt();
}
}
this.phaseSelectionStrategy.assignLiteral(p);
......
......@@ -361,6 +361,7 @@ public class GnuplotBasedSolverVisualisation implements SolverVisualisation {
} catch (InterruptedException e) {
GnuplotBasedSolverVisualisation.this.logger
.log(e.getMessage());
Thread.currentThread().interrupt();
}
GnuplotBasedSolverVisualisation.this.logger
......
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