public List <AsteroidVisionSet> GetAsteroidVisionSets() { List <AsteroidVisionSet> avsets = new List <AsteroidVisionSet>(); for (int i = 0; i < asteroids.Count; i++) { var avset = new AsteroidVisionSet(asteroids[i], asteroids.Take(i).Concat(asteroids.Skip(i + 1))); avsets.Add(avset); } return(avsets); }
protected override void PrepareSolution() { avsets = afield.GetAsteroidVisionSets(); bestAVSet = avsets.Select(set => (set, set.VisibleAsteroidsAmount())).Aggregate((a, b) => a.Item2 > b.Item2 ? a : b).Item1; }