Ejemplo n.º 1
0
 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();
     }
 }
Ejemplo n.º 2
0
 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();
     }
 }
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 4
0
    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);
    }
Ejemplo n.º 5
0
    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);
    }
Ejemplo n.º 6
0
    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;
    }
Ejemplo n.º 7
0
    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;
    }
Ejemplo n.º 8
0
    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);
    }