Changeset 9150


Ignore:
Timestamp:
01/13/13 01:08:08 (8 years ago)
Author:
ascheibe
Message:

#1886 fixed successor configuration and added successful mutation chart

Location:
branches/HeuristicLab.Analysis.AlgorithmBehavior
Files:
3 edited

Legend:

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

    r9095 r9150  
    3333
    3434    public HeuristicOptimizationEngineAlgorithm Content { get; set; }
    35     private CombinedOperator currentSuccessor = null;
     35    private HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.CombinedOperator currentSuccessor = null;
    3636    private Type operatorType = null;
    3737
     
    4444        dialog.Caption = "Select Successor";
    4545        dialog.TypeSelector.Caption = "Available Successor Operators";
    46         dialog.TypeSelector.Configure(typeof(CombinedOperator), false, true);
     46        dialog.TypeSelector.Configure(typeof(HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.CombinedOperator), false, true);
    4747
    4848        if (dialog.ShowDialog() == DialogResult.OK) {
    49           currentSuccessor = (CombinedOperator)dialog.TypeSelector.CreateInstanceOfSelectedType();
     49          currentSuccessor = (HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.CombinedOperator)dialog.TypeSelector.CreateInstanceOfSelectedType();
    5050          successorTextBox.Text = currentSuccessor.ToString();
    5151        }
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/CrossoverPerformanceAnalyzer.cs

    r9054 r9150  
    126126
    127127
    128       worseParentCrossoverPerformancePlot = new ScatterPlotHelper(false, true);
    129       betterParentCrossoverPerformancePlot = new ScatterPlotHelper(false, true);
     128      worseParentCrossoverPerformancePlot = new ScatterPlotHelper(false, true, true);
     129      betterParentCrossoverPerformancePlot = new ScatterPlotHelper(false, true, true);
    130130      childDiversityToWorseParentHelper = new ScatterPlotHelper(false, true);
    131131      childDiversityToBetterParentHelper = new ScatterPlotHelper(false, true);
    132132      unwantedMutationsHelper = new ScatterPlotHelper(false, true);
    133133      parentDiversityHelper = new ScatterPlotHelper(false, true);
    134       parentQualityHelper = new ScatterPlotHelper(false, true);
     134      parentQualityHelper = new ScatterPlotHelper(false, true, true);
    135135      successHelper = new DataTableHelper();
    136136      equalParentsHelper = new DataTableHelper();
     
    239239
    240240          for (int i = 0; i < ComparisonFactorParameter.Value.Count; i++) {
    241             successHelper.AddPoint(SuccessfullCrossoversRowName + ComparisonFactorParameter.Value.ElementAt(i).Value.ToString(), success[i]);
     241            successHelper.AddPoint(SuccessfullCrossoversRowName + ComparisonFactorParameter.Value.ElementAt(i).Value.ToString(), (double)success[i] / (cnt - 1));
    242242          }
    243243
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/MutationPerformanceAnalyzer.cs

    r9045 r9150  
    5858      get { return (ILookupParameter<ItemCollection<IItem>>)Parameters["Operators"]; }
    5959    }
     60    public IValueLookupParameter<BoolValue> MaximizationParameter {
     61      get { return (IValueLookupParameter<BoolValue>)Parameters["Maximization"]; }
     62    }
    6063    public IValueParameter<ISingleObjectiveSolutionSimilarityCalculator> SimilarityCalculatorParameter {
    6164      get { return (IValueParameter<ISingleObjectiveSolutionSimilarityCalculator>)Parameters["SimilarityCalculator"]; }
     
    7073
    7174    [Storable]
     75    private DataTableHelper successHelper;
     76    [Storable]
    7277    private ScatterPlotHelper diversityPlotHelper, qualityPlotHelper;
    7378    [Storable]
    74     private int cnt = 0, lastGeneration = 0;
     79    private int cnt = 0, lastGeneration = 0, success = 0;
    7580
    7681    [StorableConstructor]
     
    8085      diversityPlotHelper = (ScatterPlotHelper)original.diversityPlotHelper.Clone(cloner);
    8186      qualityPlotHelper = (ScatterPlotHelper)original.qualityPlotHelper.Clone(cloner);
     87      successHelper = (DataTableHelper)original.successHelper.Clone(cloner);
    8288      cnt = original.cnt;
    8389      lastGeneration = original.lastGeneration;
     90      success = original.success;
    8491    }
    8592
     
    103110      Parameters.Add(new ValueParameter<ISingleObjectiveSolutionSimilarityCalculator>("SimilarityCalculator"));
    104111      Parameters.Add(new LookupParameter<ItemCollection<IItem>>("Operators", "The operators and items that the problem provides to the algorithms."));
     112      Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, false otherwise"));
    105113
    106114      diversityPlotHelper = new ScatterPlotHelper(false, true);
    107       qualityPlotHelper = new ScatterPlotHelper(false, true);
     115      qualityPlotHelper = new ScatterPlotHelper(false, true, true);
     116      successHelper = new DataTableHelper();
    108117    }
    109118
     
    118127      qualityPlotHelper.InitializePlot(Results, "Mutation Quality", "Solution Index", "Absolut Quality Difference");
    119128      diversityPlotHelper.InitializePlot(Results, "Mutation Diversity", "Solution Index", "Diversity");
     129      successHelper.InitializeChart(Results, "Successfull Mutations", new string[] { "Successfull Mutations per Generation" });
    120130      Reset();
    121131    }
     
    138148      curPoint = new Point2D<double>(cnt++, qualityCX - qualityM);
    139149
    140 
    141150      string curGenStr = GenerationsParameter.ActualValue.Value.ToString();
    142151
     
    144153      diversityPlotHelper.AddPoint(curGenStr, divPoint);
    145154
     155      if (GenerationsParameter.ActualValue.Value == lastGeneration) {
     156        CountSuccess(qualityCX, qualityM);
     157      }
     158
    146159      if (GenerationsParameter.ActualValue.Value != 0) {
    147160        if (GenerationsParameter.ActualValue.Value > lastGeneration) {
     161          successHelper.AddPoint((double)success / (cnt - 1));
     162
    148163          Reset();
     164          CountSuccess(qualityCX, qualityM);
    149165        }
    150166      }
     
    156172      cnt = 0;
    157173      lastGeneration = GenerationsParameter.ActualValue.Value;
     174      success = 0;
    158175    }
    159176
     
    162179      diversityPlotHelper.CleanUp();
    163180    }
     181
     182    private void CountSuccess(double qualityCX, double qualityM) {
     183      if (!MaximizationParameter.ActualValue.Value && qualityCX > qualityM) {
     184        success++;
     185      }
     186
     187      if (MaximizationParameter.ActualValue.Value && qualityCX < qualityM) {
     188        success++;
     189      }
     190    }
    164191  }
    165192}
Note: See TracChangeset for help on using the changeset viewer.