Package com.niacin.metaheuristic

Examples of com.niacin.metaheuristic.SimpleFitnessComparator


      case MOVE :
      {
        log.info("CLIMB");
        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;
            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

Related Classes of com.niacin.metaheuristic.SimpleFitnessComparator

Copyright © 2018 www.massapicom. 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.