public void generateIndividual() { for (int i = 0; i < TrailPlan.getNumberOfPoints(); i++) { setPoint(i, TrailPlan.getPoint(i)); } _trail = ShuffleList(_trail); }
private void bruteForce() { int n = TrailPlan.getNumberOfPoints(); Point[] temp = new Point[n]; for (int i = 0; i < n; i++) { temp [i] = (Point)TrailPlan.getPoint(i); } foreach (Point[] permutation in Permutation.getPermutations <Point>(temp)) { ArrayList temporary = new ArrayList(); for (int j = 0; j < permutation.Length; j++) { temporary.Add(permutation[j]); } Trail tempTrail = new Trail(temporary); bruteForcePopulation.saveTrail(permutationCounter, tempTrail); permutationCounter++; } }