Free cookie consent management tool by TermsFeed Policy Generator

Changeset 17669


Ignore:
Timestamp:
07/16/20 08:42:17 (4 years ago)
Author:
dleko
Message:

#2825 Add scatter plot for resulting fitness values.

Location:
branches/2825-NSGA3/HeuristicLab.Algorithms.NSGA3/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2825-NSGA3/HeuristicLab.Algorithms.NSGA3/3.3/NSGA3.cs

    r17668 r17669  
    6868
    6969        private const string SeedName = "Seed";
    70         private const string SetSeedRandomlyName = "SetSeedRandomly";
    71         private const string PopulationSizeName = "PopulationSize";
    72         private const string CrossoverProbabilityName = "CrossoverProbability";
    73         private const string CrossoverContiguityName = "CrossoverContiguity";
    74         private const string MutationProbabilityName = "MutationProbability";
    75         private const string MaximumGenerationsName = "MaximumGenerations";
    76         private const string DominateOnEqualQualitiesName = "DominateOnEqualQualities";
     70        private const string SetSeedRandomlyName = "Set Seed Randomly";
     71        private const string PopulationSizeName = "Population Size";
     72        private const string CrossoverProbabilityName = "Crossover Probability";
     73        private const string CrossoverContiguityName = "Crossover Contiguity";
     74        private const string MutationProbabilityName = "Mutation Probability";
     75        private const string MaximumGenerationsName = "Maximum Generations";
     76        private const string DominateOnEqualQualitiesName = "Dominate On Equal Qualities";
    7777
    7878        // Results Names
     
    8080        private const string GeneratedReferencePointsResultName = "Generated Reference Points";
    8181        private const string CurrentGenerationResultName = "Generations";
     82        private const string ScatterPlotResultName = "Scatter Plot";
    8283        private const string CurrentFrontResultName = "Pareto Front"; // Do not touch this
    8384
     
    173174            get { return (IntValue)Results[CurrentGenerationResultName].Value; }
    174175            set { Results[CurrentGenerationResultName].Value = value; }
     176        }
     177
     178        public ParetoFrontScatterPlot ResultsScatterPlot
     179        {
     180            get { return (ParetoFrontScatterPlot)Results[ScatterPlotResultName].Value; }
     181            set { Results[ScatterPlotResultName].Value = value; }
    175182        }
    176183
     
    262269            Results.Add(new Result(CurrentFrontResultName, "The Pareto Front", new DoubleMatrix()));
    263270            Results.Add(new Result(CurrentGenerationResultName, "The current generation", new IntValue(1)));
     271            Results.Add(new Result(ScatterPlotResultName, "A scatterplot displaying the evaluated solutions and (if available) the analytically optimal front", new ParetoFrontScatterPlot()));
     272
     273            var problem = Problem as MultiObjectiveTestFunctionProblem;
     274            if (problem == null) return;
     275            // todo: add BestKnownFront parameter
     276            ResultsScatterPlot = new ParetoFrontScatterPlot(new double[0][], new double[0][], null, problem.Objectives, problem.ProblemSize);
    264277        }
    265278
     
    283296
    284297                    ResultsCurrentGeneration.Value++;
     298                    Analyze();
    285299                }
    286300                catch (Exception ex)
     
    308322        private void Analyze()
    309323        {
     324            ResultsScatterPlot = new ParetoFrontScatterPlot(solutions.Select(x => x.Fitness).ToArray(), solutions.Select(x => x.Chromosome.ToArray()).ToArray(), ResultsScatterPlot.ParetoFront, ResultsScatterPlot.Objectives, ResultsScatterPlot.ProblemSize);
    310325            ResultsSolutions = solutions.Select(s => s.Chromosome.ToArray()).ToMatrix();
    311326            Problem.Analyze(
  • branches/2825-NSGA3/HeuristicLab.Algorithms.NSGA3/3.3/ReferencePoint.cs

    r17668 r17669  
    8080            }
    8181
    82             int nRefPoints = GetNumberOfGeneratedReferencePoints(nDim, outerDiv, innerDiv);
    83             return nRefPoints;
    84             //return GetNumberOfGeneratedReferencePoints(nDim, outerDiv, innerDiv);
     82            return GetNumberOfGeneratedReferencePoints(nDim, outerDiv, innerDiv);
    8583        }
    8684
Note: See TracChangeset for help on using the changeset viewer.