コード例 #1
0
 public void UpdateAttractiveness(FireflyParticle a)
 {
     if (a.PersonalBestFitness < this.PersonalBestFitness)
     {
         double distance    = AbstractFunction.EuclidianDistance(a.PersonalBestPosition, this.Position);
         double exponential = Math.Pow(Math.E, -LuciferinProductionCoefficient * distance);
         Attractiveness = AttractivenessFactor * exponential;
     }
 }