private void UpdateGlobalBestFromPersonalBest(double[] personalBestPosition)
        {
            double evaluationValue = antennaArray.Evaluate(personalBestPosition);

            if (evaluationValue < globalBestEvaluationValue)
            {
                globalBestPosition        = personalBestPosition;
                globalBestEvaluationValue = evaluationValue;
                string bestPositions = string.Empty;

                for (int index = 0; index <= personalBestPosition.Length - 1; index++)
                {
                    bestPositions += personalBestPosition[index].ToString() + ", ";
                }

                Console.WriteLine($"Current best positions are: [{bestPositions}] with a value of {globalBestEvaluationValue}");
            }
        }
 public SwarmController(RandomValidPositionGenerator randomValidPositionGenerator, AntennaArray antennaArray, double[] initialGlobalBest)
 {
     this.randomValidPositionGenerator = randomValidPositionGenerator;
     this.antennaArray         = antennaArray;
     globalBestPosition        = initialGlobalBest;
     globalBestEvaluationValue = antennaArray.Evaluate(globalBestPosition);
     swarm  = new List <Particle>();
     random = new Random();
 }