public ISquadsSetup Make(int numberOfSquads)
        {
            var source     = _setupSourceFactory.New();
            var players    = source.Players.Shuffle();
            var squadSetup = _squadSetupFactory.New(players, numberOfSquads);
            var distance   = _distanceCalculator.Calculate(source.AverageSkills, squadSetup.Squads.Select(s => s.AverageSkills));

            for (int i = 0; i < NumberOfIterations; i++)
            {
                var newPlayers = players.RandomSwap();
                squadSetup = _squadSetupFactory.New(newPlayers, numberOfSquads);
                var newDistance = _distanceCalculator.Calculate(source.AverageSkills, squadSetup.Squads.Select(s => s.AverageSkills));

                if (newDistance < distance)
                {
                    players  = newPlayers;
                    distance = newDistance;
                }
            }

            return(_squadSetupFactory.New(players, numberOfSquads));
        }
        public ISquadsSetup Make(int numberOfSquads)
        {
            var setupSource = _setupSourceFactory.New();

            var candidateSetups = Enumerable.Range(0, NumberOfShuffles)
                                  .Select(i => _squadSetupFactory.New(setupSource.Players.Shuffle(), numberOfSquads))
                                  .Select(ss => new
            {
                SquadsSetup         = ss,
                DistanceFromAverage = _distanceCalculator.Calculate(setupSource.AverageSkills, ss.Squads.Select(s => s.AverageSkills))
            })
                                  .ToArray();

            var minDistanceFromAverageSkills = candidateSetups.Min(cs => cs.DistanceFromAverage);

            return(candidateSetups.First(cs => cs.DistanceFromAverage == minDistanceFromAverageSkills).SquadsSetup);
        }