コード例 #1
0
ファイル: Trail.cs プロジェクト: TomaszGodlewski/Trail
 public void generateIndividual()
 {
     for (int i = 0; i < TrailPlan.getNumberOfPoints(); i++)
     {
         setPoint(i, TrailPlan.getPoint(i));
     }
     _trail = ShuffleList(_trail);
 }
コード例 #2
0
ファイル: Trail.cs プロジェクト: TomaszGodlewski/Trail
 public Trail()
 {
     _trail = new ArrayList();
     for (int i = 0; i < TrailPlan.getNumberOfPoints(); i++)
     {
         _trail.Add(null);
     }
 }
コード例 #3
0
    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);
            }
        }
    }
コード例 #4
0
    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++;
        }
    }