Mentions légales du service

Skip to content
Snippets Groups Projects

Develop to Master

Merged YUKI Tomofumi requested to merge develop into master
4 files
+ 33
23
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -20,7 +20,7 @@ import gecos.core.Symbol;
import typeexploration.SolutionSpace;
/**
* @author aelmouss
* @author phuhv
*/
public class TabuExploration extends AbstractExplorationAlgorithm {
@@ -108,12 +108,12 @@ public class TabuExploration extends AbstractExplorationAlgorithm {
}
}
if(!getAccuracy(solution).isPresent() || !getCost(solution).isPresent())
if(!getAccuracy(optimalSol).isPresent() || !getCost(optimalSol).isPresent())
throw new NoSolutionFoundException("Failed to find a solution likely because the minimun precision "
+ "configuration of some Symbols is too low, resulting in errors (like divide by zero for example).\n"
+ "Try rerun after enabling pruning or increasing the minimum W values of some symbols.");
if(!userAccuracyConstraint.isValid(solution))
if(!userAccuracyConstraint.isValid(optimalSol))
throw new NoSolutionFoundException("No valid solution was found!");
logger.info("Finished exploration.");
@@ -147,7 +147,6 @@ public class TabuExploration extends AbstractExplorationAlgorithm {
try {
evaluateAccuracy(nextSolution);
evaluateCost(nextSolution);
display(nextSolution);
synchronized (nextSolutionCandidates) {
nextSolutionCandidates.add(nextExplorer);
}
@@ -171,7 +170,7 @@ public class TabuExploration extends AbstractExplorationAlgorithm {
logger.warning("Skipping next solution (direction down) candidate: " + nextSolution.getID() + " cause: " + e.getMessage());
}
}
else { //already at max (min) and direction up (down)
else if (indexMax == 0) {
synchronized (finished) {
logger.fine(() -> "Symbol exploration finished; already at " + (directionUp? "max W & direction is up" : "min W & direction is down") + ": " + symbol);
newlyFinished.add(symbol);
@@ -277,7 +276,8 @@ public class TabuExploration extends AbstractExplorationAlgorithm {
if(higherIsBetter)
diff = -diff;
if (Math.abs(diff) < 0.0000001) {
// if (Math.abs(diff) < 0.0000001) {
if (Math.abs(diff) < 0.000000000001) {
diff = 0;
}
return diff + 1;
Loading