예제 #1
0
파일: Program.cs 프로젝트: lanicon/Neatron
 public bool IsDominatedBy(ParetoFrontPoint other)
 {
     return(other.Fitness >= Fitness &&
            other.Simplicity > Simplicity ||
            other.Fitness > Fitness &&
            other.Simplicity >= Simplicity);
 }
예제 #2
0
 public WinnerViewModel(ParetoFrontPoint paretoFrontPoint, IReadOnlyList <float> evaluationResult, int run, int generation)
 {
     ParetoFrontPoint = paretoFrontPoint;
     EvaluationResult = evaluationResult;
     Run        = run;
     Generation = generation;
 }
예제 #3
0
파일: Program.cs 프로젝트: lanicon/Neatron
            private static void SetParetoRank(ParetoFrontPoint point, ICollection <ParetoFrontPoint> ranks)
            {
                var maxNonDominantFrontNumber = 0;

                foreach (var r in ranks)
                {
                    if (point.IsDominatedBy(r) && maxNonDominantFrontNumber < r.Rank)
                    {
                        maxNonDominantFrontNumber = r.Rank;
                    }
                }

                point.Rank = maxNonDominantFrontNumber + 1;
                ranks.Add(point);
            }
예제 #4
0
파일: Program.cs 프로젝트: lanicon/Neatron
            public bool IsBetterThan(ParetoFrontPoint other)
            {
                if (this == other)
                {
                    return(false);
                }

                if (Rank < other.Rank)
                {
                    return(true);
                }
                if (Rank > other.Rank)
                {
                    return(false);
                }

                if (Sparsity < other.Sparsity)
                {
                    return(false);
                }
                if (Sparsity > other.Sparsity)
                {
                    return(true);
                }

                if (Fitness > other.Fitness)
                {
                    return(true);
                }
                if (Fitness < other.Fitness)
                {
                    return(false);
                }

                if (Simplicity > other.Simplicity)
                {
                    return(true);
                }
                if (Simplicity < other.Simplicity)
                {
                    return(false);
                }

                return(false);
            }
예제 #5
0
 private static bool IsBetterFitness(ParetoFrontPoint curr, ParetoFrontPoint candidate)
 {
     return(curr.Fitness < candidate.Fitness ||
            Math.Abs(curr.Fitness - candidate.Fitness) <= float.Epsilon && curr.Complexity > candidate.Complexity);
 }
예제 #6
0
 private static bool IsBetterComplexity(ParetoFrontPoint curr, ParetoFrontPoint candidate)
 {
     return(curr.Complexity > candidate.Complexity ||
            curr.Complexity == candidate.Complexity && curr.Fitness < candidate.Fitness);
 }