Package com.niacin.metaheuristic

Examples of com.niacin.metaheuristic.SimpleFitnessComparator.compare()


        double bestImprovement = 0;
        boolean moved = false;
        FitnessComparator comparator = new SimpleFitnessComparator();
        for (Solution neighbour : neighbours)
        {
          double improvement = comparator.compare(problem, neighbour, currentSolution);
          if (improvement > bestImprovement)
          {
            currentSolution = neighbour;
            nextSolution = neighbour;
            bestImprovement = improvement;
View Full Code Here


            currentSolution = neighbour;
            nextSolution = neighbour;
            bestImprovement = improvement;
            moved = true;

            if (comparator.compare(problem, neighbour, bag.getBestSoFarSolution()) > 0)
            {
              log.info("UPDATING BEST SO FAR. FITNESS:" + neighbour.getFitness());
              bestSoFarSolution = neighbour;
            }
          }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.