public void updateBestWorstKrill(Krill krill) { if(krill.getFitnessValue() < bestFitnessValue){ bestKrill = krill; bestFitnessValue = krill.getFitnessValue(); bestFitnessPosition = krill.getPosition().getClone(); } if(krill.getFitnessValue() > worstFitnessValue){ worstFitnessValue = krill.getFitnessValue(); } }
public void updateBestWorstKrill(Krill krill) { if (krill.getFitnessValue() < bestFitnessValue) { bestKrill = krill; bestFitnessValue = krill.getFitnessValue(); bestFitnessPosition = krill.getPosition().getClone(); } if (krill.getFitnessValue() > worstFitnessValue) { worstFitnessValue = krill.getFitnessValue(); } }
private Position calculateBetaBest(Krill krill, HerdParameters parameters) { Position bestRelatedPosition = tendencyCalculator.calculateRelatedPosition(krill.getBestPosition(),krill.getPosition()); float bestFitness = tendencyCalculator.calculateRelatedFitness(krill.getFitnessValue(),krill.getBestPositionFitness(),parameters); //Debug.Log("best fitness " + bestFitness); bestRelatedPosition = bestRelatedPosition * bestFitness; return bestRelatedPosition; }
private Position calculateBetaBest(Krill krill, HerdParameters parameters) { Position bestRelatedPosition = tendencyCalculator.calculateRelatedPosition(krill.getBestPosition(), krill.getPosition()); float bestFitness = tendencyCalculator.calculateRelatedFitness(krill.getFitnessValue(), krill.getBestPositionFitness(), parameters); //Debug.Log("best fitness " + bestFitness); bestRelatedPosition = bestRelatedPosition * bestFitness; return(bestRelatedPosition); }
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); }
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; }
private Position calculateAlphaLocal(List<Krill> neighbours, Krill krill, HerdParameters parameters) { Position alphaLocal = new Position(); foreach (Krill neighbour in neighbours) { Position relatedPosition = tendencyCalculator.calculateRelatedPosition(neighbour.getPosition(), krill.getPosition()); float relatedFitness = tendencyCalculator.calculateRelatedFitness(krill.getFitnessValue(),neighbour.getFitnessValue(), parameters); relatedPosition = relatedPosition * relatedFitness; alphaLocal = alphaLocal + relatedPosition; } return alphaLocal; }
private Position calculateAlphaLocal(List <Krill> neighbours, Krill krill, HerdParameters parameters) { Position alphaLocal = new Position(); foreach (Krill neighbour in neighbours) { Position relatedPosition = tendencyCalculator.calculateRelatedPosition(neighbour.getPosition(), krill.getPosition()); float relatedFitness = tendencyCalculator.calculateRelatedFitness(krill.getFitnessValue(), neighbour.getFitnessValue(), parameters); relatedPosition = relatedPosition * relatedFitness; alphaLocal = alphaLocal + relatedPosition; } return(alphaLocal); }