public void crossoverHerd(List<Krill> herd, HerdParameters parameters) { foreach (Krill krill in herd) { float Cr = 0.2f * tendencyCalculator.calculateRelatedFitness(krill.getFitnessValue(), parameters.getBestFitnessValue(), parameters); float ran = Random.Range(0.0f,1.0f); if (ran < Cr) { crossKrill(krill, herd); } } }
private Position calculateAlphaTarget(HerdParameters parameters, Krill krill) { Position relatedPosition = tendencyCalculator.calculateRelatedPosition(parameters.getBestFitnessPosition(), krill.getPosition()); float relatedFitness = tendencyCalculator.calculateRelatedFitness(krill.getFitnessValue(),parameters.getBestFitnessValue(), parameters); relatedPosition = relatedPosition * relatedFitness; relatedPosition = relatedPosition * calculateCoefficient(parameters); return relatedPosition; }
public void mutateHerd(List<Krill> herd, HerdParameters parameters) { foreach (Krill krill in herd) { float Mu = 0.05f / tendencyCalculator.calculateRelatedFitness(krill.getFitnessValue(), parameters.getBestFitnessValue(), parameters); float ran = Random.Range(0.0f,1.0f); if (ran < Mu) { mutateKrill(krill, herd, parameters); } } }
public void crossoverHerd(List <Krill> herd, HerdParameters parameters) { foreach (Krill krill in herd) { float Cr = 0.2f * tendencyCalculator.calculateRelatedFitness(krill.getFitnessValue(), parameters.getBestFitnessValue(), parameters); float ran = Random.Range(0.0f, 1.0f); if (ran < Cr) { crossKrill(krill, herd); } } }
private Position calculateAlphaTarget(HerdParameters parameters, Krill krill) { Position relatedPosition = tendencyCalculator.calculateRelatedPosition(parameters.getBestFitnessPosition(), krill.getPosition()); float relatedFitness = tendencyCalculator.calculateRelatedFitness(krill.getFitnessValue(), parameters.getBestFitnessValue(), parameters); relatedPosition = relatedPosition * relatedFitness; relatedPosition = relatedPosition * calculateCoefficient(parameters); return(relatedPosition); }
public void mutateHerd(List <Krill> herd, HerdParameters parameters) { foreach (Krill krill in herd) { float Mu = 0.05f / tendencyCalculator.calculateRelatedFitness(krill.getFitnessValue(), parameters.getBestFitnessValue(), parameters); float ran = Random.Range(0.0f, 1.0f); if (ran < Mu) { mutateKrill(krill, herd, parameters); } } }