public static bool betterFitness(Individual bestSol, Individual newBestSol) { if (bestSol.getFitness() != double.Epsilon) { if (FitnessCalc._op == Operation.Max) { return(bestSol.getFitness() <= newBestSol.getFitness()); } else { return(bestSol.getFitness() >= newBestSol.getFitness()); } } else { return(false); } }
private static bool betterFitness(Individual fittest, int i) { if (fittest.getFitness() != double.Epsilon) { if (_op == Operation.Max) { return(fittest.getFitness() <= currentPopulation.getIndividual(i).getFitness()); } else { return(fittest.getFitness() >= currentPopulation.getIndividual(i).getFitness()); } } else { return(false); } }
public static double getProb(Individual individual) { if (individual.getFitness() != double.Epsilon) { double prob = individual.getFitness() / _sumPopulationFitness; if (_op == Operation.Max) { return(prob); } else { return(1 - prob); } } else { return(0.0); } }
public static double getProb(Individual individual) { if(individual.getFitness() != double.Epsilon) { double prob = individual.getFitness() / _sumPopulationFitness; if (_op == Operation.Max) { return prob; } else { return (1 - prob); } } else { return 0.0; } }
public static double getExpectedCount(Individual individual) { double expectedCount = individual.getFitness() / _avgPopulationFitness; return expectedCount; }
private static bool betterFitness(Individual fittest, int i) { if (fittest.getFitness() != double.Epsilon) { if (_op == Operation.Max) { return fittest.getFitness() <= currentPopulation.getIndividual(i).getFitness(); } else { return fittest.getFitness() >= currentPopulation.getIndividual(i).getFitness(); } } else { return false; } }
public static double getExpectedCount(Individual individual) { double expectedCount = individual.getFitness() / _avgPopulationFitness; return(expectedCount); }
public static bool betterFitness(Individual bestSol, Individual newBestSol) { if (bestSol.getFitness() != double.Epsilon) { if (FitnessCalc._op == Operation.Max) { return bestSol.getFitness() <= newBestSol.getFitness(); } else { return bestSol.getFitness() >= newBestSol.getFitness(); } } else { return false; } }