public void generateIndividual() { for (int i = 0; i < TrailPlan.getNumberOfPoints(); i++) { setPoint(i, TrailPlan.getPoint(i)); } _trail = ShuffleList(_trail); }
public Trail() { _trail = new ArrayList(); for (int i = 0; i < TrailPlan.getNumberOfPoints(); i++) { _trail.Add(null); } }
private void pointsDistribution(int arrayLength) { TrailPlan.addPoint(new Point()); while (TrailPlan.getNumberOfPoints() < arrayLength) { Point tempPoint = new Point(); if ((!isContain(TrailPlan.getTrailPlan(), tempPoint)) && UnityEngine.Random.value <= 0.2) { TrailPlan.addPoint(tempPoint); } } }
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++; } }