Changeset 9185


Ignore:
Timestamp:
01/24/13 01:06:46 (7 years ago)
Author:
ascheibe
Message:

#1886 fixed scaling of qualities

Location:
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3
Files:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/AfterCrossoverCombinedOperator.cs

    r9054 r9185  
    4040    protected VariableDuplicator varDuplicator;
    4141
     42    [Storable]
     43    protected WorstQualityAnalyzer wqAnalyzer;
     44
    4245    public ILookupParameter<IEvaluator> EvaluatorParameter {
    4346      get { return ((LookupParameter<IEvaluator>)Parameters["Evaluator"]); }
     
    7982      solToPopAnalyzer = new SolutionToPopulationAnalyzer();
    8083      solToPopAnalyzer.ChartPostfixParameter.Value = new Data.StringValue("after Crossover");
     84      wqAnalyzer = new WorstQualityAnalyzer();
    8185
     86      Operators.Add(wqAnalyzer);
    8287      Operators.Add(EvaluatorParameter.ActualValue);
    8388      Operators.Add(cxAnalyzer);
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/CombinedOperators/QAPAfterCrossoverCombinedOperator.cs

    r9054 r9185  
    6363      solToPopAnalyzer.SolutionParameter.ActualName = "Assignment";
    6464      solToPopAnalyzer.QualityParameter.ActualName = "Quality";
     65
     66      wqAnalyzer.ParentsQualityParameter.ActualName = "Quality";
    6567    }
    6668  }
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/CombinedOperators/TFAfterCrossoverCombinedOperator.cs

    r9054 r9185  
    5959      solToPopAnalyzer.SolutionParameter.ActualName = "Point";
    6060      solToPopAnalyzer.QualityParameter.ActualName = "Quality";
     61
     62      wqAnalyzer.ParentsQualityParameter.ActualName = "Quality";
    6163      //TODO: add unwanted mutation analyzer for TF
    6264    }
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/CombinedOperators/VRPAfterCrossoverCombinedOperator.cs

    r9054 r9185  
    5959      solToPopAnalyzer.SolutionParameter.ActualName = "VRPTours";
    6060      solToPopAnalyzer.QualityParameter.ActualName = "Quality";
     61
     62      wqAnalyzer.ParentsQualityParameter.ActualName = "Quality";
    6163    }
    6264  }
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/CrossoverPerformanceAnalyzer.cs

    r9150 r9185  
    6767      get { return (ILookupParameter<ItemCollection<IItem>>)Parameters["Operators"]; }
    6868    }
     69    public ILookupParameter<DoubleValue> BestKnownQualityParameter {
     70      get { return (ILookupParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
     71    }
     72    public ILookupParameter<DoubleValue> WorstKnownQualityParameter {
     73      get { return (ILookupParameter<DoubleValue>)Parameters["WorstKnownQuality"]; }
     74    }
    6975    #endregion
    7076
     
    124130      Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, false otherwise"));
    125131      Parameters.Add(new ValueLookupParameter<ItemCollection<DoubleValue>>("ComparisonFactor", "Determines if the quality should be compared to the better parent (1.0), to the worse (0.0) or to any linearly interpolated value between them."));
    126 
     132      Parameters.Add(new LookupParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this problem."));
     133      Parameters.Add(new LookupParameter<DoubleValue>("WorstKnownQuality", "The quality of the worst known solution of this problem."));
    127134
    128135      worseParentCrossoverPerformancePlot = new ScatterPlotHelper(false, true, true);
     
    172179      }
    173180      successHelper.InitializeChart(Results, "Successfull Crossovers", successfullCXRowNames.ToArray());
     181
    174182      Reset();
    175183    }
     
    234242      }
    235243
     244      if (GenerationsParameter.ActualValue.Value == 1) {
     245        double bkQuality = BestKnownQualityParameter.ActualValue.Value;
     246        double wkQuality = WorstKnownQualityParameter.ActualValue.Value;
     247
     248        if (MaximizationParameter.ActualValue.Value) {
     249          if (worseParentCrossoverPerformancePlot.Max == double.MinValue) {
     250            worseParentCrossoverPerformancePlot.Max = bkQuality - wkQuality;
     251            betterParentCrossoverPerformancePlot.Max = bkQuality - wkQuality;
     252            parentQualityHelper.Max = bkQuality - wkQuality;
     253            worseParentCrossoverPerformancePlot.Min = 0;
     254            betterParentCrossoverPerformancePlot.Min = 0;
     255            parentQualityHelper.Min = 0;
     256          }
     257        } else {
     258          if (worseParentCrossoverPerformancePlot.Min == double.MaxValue) {
     259            worseParentCrossoverPerformancePlot.Max = wkQuality - bkQuality;
     260            betterParentCrossoverPerformancePlot.Max = wkQuality - bkQuality;
     261            parentQualityHelper.Max = wkQuality - bkQuality;
     262            worseParentCrossoverPerformancePlot.Min = 0;
     263            betterParentCrossoverPerformancePlot.Min = 0;
     264            parentQualityHelper.Min = 0;
     265          }
     266        }
     267      }
     268
    236269      if (GenerationsParameter.ActualValue.Value != 0) {
    237270        if (GenerationsParameter.ActualValue.Value > lastGeneration) {
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers-3.3.csproj

    r9095 r9185  
    113113    <Compile Include="CombinedOperators\QAPAfterMutationCombinedOperator.cs" />
    114114    <Compile Include="CombinedOperators\QAPAfterCrossoverCombinedOperator.cs" />
     115    <Compile Include="WorstQualityAnalyzer.cs" />
    115116    <Compile Include="InitializableOperator.cs" />
    116117    <Compile Include="SolutionToPopulationAnalyzer.cs" />
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/MutationPerformanceAnalyzer.cs

    r9150 r9185  
    6363    public IValueParameter<ISingleObjectiveSolutionSimilarityCalculator> SimilarityCalculatorParameter {
    6464      get { return (IValueParameter<ISingleObjectiveSolutionSimilarityCalculator>)Parameters["SimilarityCalculator"]; }
     65    }
     66    public ILookupParameter<DoubleValue> BestKnownQualityParameter {
     67      get { return (ILookupParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
     68    }
     69    public ILookupParameter<DoubleValue> WorstKnownQualityParameter {
     70      get { return (ILookupParameter<DoubleValue>)Parameters["WorstKnownQuality"]; }
    6571    }
    6672    #endregion
     
    111117      Parameters.Add(new LookupParameter<ItemCollection<IItem>>("Operators", "The operators and items that the problem provides to the algorithms."));
    112118      Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, false otherwise"));
     119      Parameters.Add(new LookupParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this problem."));
     120      Parameters.Add(new LookupParameter<DoubleValue>("WorstKnownQuality", "The quality of the worst known solution of this problem."));
    113121
    114122      diversityPlotHelper = new ScatterPlotHelper(false, true);
     
    157165      }
    158166
     167      if (GenerationsParameter.ActualValue.Value == 1) {
     168        double bkQuality = BestKnownQualityParameter.ActualValue.Value;
     169        double wkQuality = WorstKnownQualityParameter.ActualValue.Value;
     170
     171        if (MaximizationParameter.ActualValue.Value) {
     172          if (qualityPlotHelper.Max == double.MinValue) {
     173            qualityPlotHelper.Max = bkQuality - wkQuality;
     174            qualityPlotHelper.Min = 0;
     175          }
     176        } else {
     177          if (qualityPlotHelper.Min == double.MaxValue) {
     178            qualityPlotHelper.Max = wkQuality - bkQuality;
     179            qualityPlotHelper.Min = 0;
     180          }
     181        }
     182      }
     183
    159184      if (GenerationsParameter.ActualValue.Value != 0) {
    160185        if (GenerationsParameter.ActualValue.Value > lastGeneration) {
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/ScatterPlotHelper.cs

    r9059 r9185  
    5252    [Storable]
    5353    private double min;
     54    public double Min {
     55      get { return min; }
     56      set { min = value; }
     57    }
    5458    [Storable]
    5559    private double max;
     60    public double Max {
     61      get { return max; }
     62      set { max = value; }
     63    }
     64
    5665    [Storable]
    5766    private ResultCollection Results;
     
    7079      StoreHistory = original.StoreHistory;
    7180      CreateDataTable = original.CreateDataTable;
     81      min = original.min;
     82      max = original.max;
     83
     84      chartName = original.chartName;
     85      chartName = original.chartName;
     86      xAxisTitle = original.xAxisTitle;
     87      yAxisTitle = original.yAxisTitle;
    7288    }
    7389
     
    120136
    121137    public void AddPoint(string rowName, Point2D<double> point) {
    122       if (point.Y > max)
    123         max = point.Y;
    124       if (point.Y < min)
    125         min = point.Y;
    126 
    127138      if (!Plot.Rows.ContainsKey(rowName)) {
    128139        if (StoreHistory)
     
    166177        plot = null;
    167178      }
     179      min = double.MaxValue;
     180      max = double.MinValue;
    168181    }
    169182  }
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/SolutionToPopulationAnalyzer.cs

    r9059 r9185  
    6161    public IValueParameter<StringValue> ChartPostfixParameter {
    6262      get { return (IValueParameter<StringValue>)Parameters["ChartPostfix"]; }
     63    }
     64    public ILookupParameter<DoubleValue> BestKnownQualityParameter {
     65      get { return (ILookupParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
     66    }
     67    public ILookupParameter<DoubleValue> WorstKnownQualityParameter {
     68      get { return (ILookupParameter<DoubleValue>)Parameters["WorstKnownQuality"]; }
    6369    }
    6470    #endregion
     
    99105      Parameters.Add(new LookupParameter<ItemCollection<IItem>>("Operators", "The operators and items that the problem provides to the algorithms."));
    100106      Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, false otherwise"));
     107      Parameters.Add(new LookupParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this problem."));
     108      Parameters.Add(new LookupParameter<DoubleValue>("WorstKnownQuality", "The quality of the worst known solution of this problem."));
    101109
    102110      populationDiversityPlot = new ScatterPlotHelper(false, true);
     
    154162        }
    155163
     164        if (GenerationsParameter.ActualValue.Value == 1) {
     165          double bkQuality = BestKnownQualityParameter.ActualValue.Value;
     166          double wkQuality = WorstKnownQualityParameter.ActualValue.Value;
     167
     168          if (MaximizationParameter.ActualValue.Value) {
     169            if (populationQualityPlot.Max == double.MinValue) {
     170              populationQualityPlot.Max = bkQuality - wkQuality;
     171              qualityPlot.Max = bkQuality;
     172              populationQualityPlot.Min = 0;
     173              qualityPlot.Min = wkQuality;
     174            }
     175          } else {
     176            if (populationQualityPlot.Min == double.MaxValue) {
     177              populationQualityPlot.Max = wkQuality - bkQuality;
     178              qualityPlot.Max = wkQuality;
     179              populationQualityPlot.Min = 0;
     180              qualityPlot.Min = bkQuality;
     181            }
     182          }
     183        }
     184
    156185        Point2D<double> popQualityPoint;
    157186        if (MaximizationParameter.ActualValue.Value) {
Note: See TracChangeset for help on using the changeset viewer.