Changeset 3616


Ignore:
Timestamp:
05/05/10 00:48:18 (12 years ago)
Author:
swagner
Message:

Worked on refactoring of algorithm analysis and tracing (#999)

  • adapted GA and TSP
  • removed stuff related to visualizers
Location:
trunk/sources
Files:
2 added
6 deleted
34 edited
1 copied
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/GeneticAlgorithm.cs

    r3376 r3616  
    3333using HeuristicLab.PluginInfrastructure;
    3434using HeuristicLab.Random;
     35using HeuristicLab.Analysis;
    3536
    3637namespace HeuristicLab.Algorithms.GeneticAlgorithm {
     
    7778      get { return (ValueParameter<IntValue>)Parameters["Elites"]; }
    7879    }
     80    private ValueParameter<MultiAnalyzer> AnalyzerParameter {
     81      get { return (ValueParameter<MultiAnalyzer>)Parameters["Analyzer"]; }
     82    }
    7983    private ValueParameter<IntValue> MaximumGenerationsParameter {
    8084      get { return (ValueParameter<IntValue>)Parameters["MaximumGenerations"]; }
     
    115119      set { ElitesParameter.Value = value; }
    116120    }
     121    public MultiAnalyzer Analyzer {
     122      get { return AnalyzerParameter.Value; }
     123      set { AnalyzerParameter.Value = value; }
     124    }
    117125    public IntValue MaximumGenerations {
    118126      get { return MaximumGenerationsParameter.Value; }
     
    132140      get { return selectors; }
    133141    }
     142    private BestAverageWorstQualityAnalyzer qualityAnalyzer;
    134143    #endregion
    135144
     
    144153      Parameters.Add(new OptionalConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions."));
    145154      Parameters.Add(new ValueParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.", new IntValue(1)));
     155      Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze each generation.", new MultiAnalyzer()));
    146156      Parameters.Add(new ValueParameter<IntValue>("MaximumGenerations", "The maximum number of generations which should be processed.", new IntValue(1000)));
    147157
     
    168178      geneticAlgorithmMainLoop.MutationProbabilityParameter.ActualName = MutationProbabilityParameter.Name;
    169179      geneticAlgorithmMainLoop.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName;
     180      geneticAlgorithmMainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name;
    170181      geneticAlgorithmMainLoop.ResultsParameter.ActualName = "Results";
    171182
     
    189200      ParameterizeStochasticOperator(Problem.SolutionCreator);
    190201      ParameterizeStochasticOperator(Problem.Evaluator);
    191       ParameterizeStochasticOperator(Problem.Visualizer);
    192202      foreach (IOperator op in Problem.Operators) ParameterizeStochasticOperator(op);
    193203      ParameterizeSolutionsCreator();
    194204      ParameterizeGeneticAlgorithmMainLoop();
    195205      ParameterizeSelectors();
     206      ParameterizeAnalyzers();
    196207      UpdateCrossovers();
    197208      UpdateMutators();
     209      UpdateAnalyzers();
    198210      Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
    199       if (Problem.Visualizer != null) Problem.Visualizer.VisualizationParameter.ActualNameChanged += new EventHandler(Visualizer_VisualizationParameter_ActualNameChanged);
    200211      base.OnProblemChanged();
    201212    }
     
    211222      ParameterizeGeneticAlgorithmMainLoop();
    212223      ParameterizeSelectors();
     224      ParameterizeAnalyzers();
    213225      Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
    214226      base.Problem_EvaluatorChanged(sender, e);
    215     }
    216     protected override void Problem_VisualizerChanged(object sender, EventArgs e) {
    217       ParameterizeStochasticOperator(Problem.Visualizer);
    218       ParameterizeGeneticAlgorithmMainLoop();
    219       if (Problem.Visualizer != null) Problem.Visualizer.VisualizationParameter.ActualNameChanged += new EventHandler(Visualizer_VisualizationParameter_ActualNameChanged);
    220       base.Problem_VisualizerChanged(sender, e);
    221227    }
    222228    protected override void Problem_OperatorsChanged(object sender, EventArgs e) {
     
    224230      UpdateCrossovers();
    225231      UpdateMutators();
     232      UpdateAnalyzers();
    226233      base.Problem_OperatorsChanged(sender, e);
    227234    }
     
    243250      ParameterizeGeneticAlgorithmMainLoop();
    244251      ParameterizeSelectors();
    245     }
    246     private void Visualizer_VisualizationParameter_ActualNameChanged(object sender, EventArgs e) {
    247       ParameterizeGeneticAlgorithmMainLoop();
     252      ParameterizeAnalyzers();
    248253    }
    249254    #endregion
     
    253258    private void Initialize() {
    254259      InitializeSelectors();
     260      InitializeAnalyzers();
    255261      UpdateSelectors();
     262      UpdateAnalyzers();
    256263      PopulationSizeParameter.ValueChanged += new EventHandler(PopulationSizeParameter_ValueChanged);
    257264      PopulationSize.ValueChanged += new EventHandler(PopulationSize_ValueChanged);
     
    262269        UpdateMutators();
    263270        Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
    264         if (Problem.Visualizer != null) Problem.Visualizer.VisualizationParameter.ActualNameChanged += new EventHandler(Visualizer_VisualizationParameter_ActualNameChanged);
    265271      }
    266272    }
     
    271277    }
    272278    private void ParameterizeGeneticAlgorithmMainLoop() {
    273       GeneticAlgorithmMainLoop.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name;
    274279      GeneticAlgorithmMainLoop.EvaluatorParameter.ActualName = Problem.EvaluatorParameter.Name;
    275280      GeneticAlgorithmMainLoop.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
    276281      GeneticAlgorithmMainLoop.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
    277       GeneticAlgorithmMainLoop.VisualizerParameter.ActualName = Problem.VisualizerParameter.Name;
    278       if (Problem.Visualizer != null)
    279         GeneticAlgorithmMainLoop.VisualizationParameter.ActualName = Problem.Visualizer.VisualizationParameter.ActualName;
    280282    }
    281283    private void ParameterizeStochasticOperator(IOperator op) {
     
    287289      selectors.AddRange(ApplicationManager.Manager.GetInstances<ISelector>().Where(x => !(x is IMultiObjectiveSelector)).OrderBy(x => x.Name));
    288290      ParameterizeSelectors();
     291    }
     292    private void InitializeAnalyzers() {
     293      qualityAnalyzer = new BestAverageWorstQualityAnalyzer();
     294      ParameterizeAnalyzers();
    289295    }
    290296    private void ParameterizeSelectors() {
     
    299305          selector.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
    300306        }
     307      }
     308    }
     309    private void ParameterizeAnalyzers() {
     310      qualityAnalyzer.ResultsParameter.ActualName = "Results";
     311      if (Problem != null) {
     312        qualityAnalyzer.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
     313        qualityAnalyzer.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
     314        qualityAnalyzer.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name;
    301315      }
    302316    }
     
    335349      }
    336350    }
     351    private void UpdateAnalyzers() {
     352      Analyzer.Operators.Clear();
     353      Analyzer.Operators.Add(qualityAnalyzer);
     354      if (Problem != null) {
     355        foreach (IAnalyzer analyzer in Problem.Operators.OfType<IAnalyzer>().OrderBy(x => x.Name))
     356          Analyzer.Operators.Add(analyzer);
     357      }
     358    }
    337359    #endregion
    338360  }
  • trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/GeneticAlgorithmMainLoop.cs

    r3376 r3616  
    4747      get { return (SubScopesLookupParameter<DoubleValue>)Parameters["Quality"]; }
    4848    }
    49     public ValueLookupParameter<DoubleValue> BestKnownQualityParameter {
    50       get { return (ValueLookupParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
    51     }
    5249    public ValueLookupParameter<IOperator> SelectorParameter {
    5350      get { return (ValueLookupParameter<IOperator>)Parameters["Selector"]; }
     
    7471      get { return (ValueLookupParameter<VariableCollection>)Parameters["Results"]; }
    7572    }
    76     public ValueLookupParameter<IOperator> VisualizerParameter {
    77       get { return (ValueLookupParameter<IOperator>)Parameters["Visualizer"]; }
    78     }
    79     public LookupParameter<IItem> VisualizationParameter {
    80       get { return (LookupParameter<IItem>)Parameters["Visualization"]; }
     73    public ValueLookupParameter<IOperator> AnalyzerParameter {
     74      get { return (ValueLookupParameter<IOperator>)Parameters["Analyzer"]; }
    8175    }
    8276    private ScopeParameter CurrentScopeParameter {
     
    10195      Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, otherwise false."));
    10296      Parameters.Add(new SubScopesLookupParameter<DoubleValue>("Quality", "The value which represents the quality of a solution."));
    103       Parameters.Add(new ValueLookupParameter<DoubleValue>("BestKnownQuality", "The best known quality value found so far."));
    10497      Parameters.Add(new ValueLookupParameter<IOperator>("Selector", "The operator used to select solutions for reproduction."));
    10598      Parameters.Add(new ValueLookupParameter<IOperator>("Crossover", "The operator used to cross solutions."));
     
    110103      Parameters.Add(new ValueLookupParameter<IntValue>("MaximumGenerations", "The maximum number of generations which should be processed."));
    111104      Parameters.Add(new ValueLookupParameter<VariableCollection>("Results", "The variable collection where results should be stored."));
    112       Parameters.Add(new ValueLookupParameter<IOperator>("Visualizer", "The operator used to visualize solutions."));
    113       Parameters.Add(new LookupParameter<IItem>("Visualization", "The item which represents the visualization of solutions."));
     105      Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to analyze each generation."));
    114106      Parameters.Add(new ScopeParameter("CurrentScope", "The current scope which represents a population of solutions on which the genetic algorithm should be applied."));
    115107      #endregion
     
    117109      #region Create operators
    118110      VariableCreator variableCreator = new VariableCreator();
    119       BestQualityMemorizer bestQualityMemorizer1 = new BestQualityMemorizer();
    120       BestQualityMemorizer bestQualityMemorizer2 = new BestQualityMemorizer();
    121       BestAverageWorstQualityCalculator bestAverageWorstQualityCalculator1 = new BestAverageWorstQualityCalculator();
    122       DataTableValuesCollector dataTableValuesCollector1 = new DataTableValuesCollector();
    123       QualityDifferenceCalculator qualityDifferenceCalculator1 = new QualityDifferenceCalculator();
    124       Placeholder visualizer1 = new Placeholder();
    125       ResultsCollector resultsCollector = new ResultsCollector();
     111      ResultsCollector resultsCollector1 = new ResultsCollector();
     112      Placeholder analyzer1 = new Placeholder();
    126113      Placeholder selector = new Placeholder();
    127114      SubScopesProcessor subScopesProcessor1 = new SubScopesProcessor();
     
    139126      IntCounter intCounter = new IntCounter();
    140127      Comparator comparator = new Comparator();
    141       BestQualityMemorizer bestQualityMemorizer3 = new BestQualityMemorizer();
    142       BestQualityMemorizer bestQualityMemorizer4 = new BestQualityMemorizer();
    143       BestAverageWorstQualityCalculator bestAverageWorstQualityCalculator2 = new BestAverageWorstQualityCalculator();
    144       DataTableValuesCollector dataTableValuesCollector2 = new DataTableValuesCollector();
    145       QualityDifferenceCalculator qualityDifferenceCalculator2 = new QualityDifferenceCalculator();
    146       Placeholder visualizer2 = new Placeholder();
     128      ResultsCollector resultsCollector2 = new ResultsCollector();
     129      Placeholder analyzer2 = new Placeholder();
    147130      ConditionalBranch conditionalBranch = new ConditionalBranch();
    148131
    149132      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0)));
    150133
    151       bestQualityMemorizer1.BestQualityParameter.ActualName = "BestQuality";
    152       bestQualityMemorizer1.MaximizationParameter.ActualName = "Maximization";
    153       bestQualityMemorizer1.QualityParameter.ActualName = "Quality";
    154 
    155       bestQualityMemorizer2.BestQualityParameter.ActualName = "BestKnownQuality";
    156       bestQualityMemorizer2.MaximizationParameter.ActualName = "Maximization";
    157       bestQualityMemorizer2.QualityParameter.ActualName = "Quality";
    158 
    159       bestAverageWorstQualityCalculator1.AverageQualityParameter.ActualName = "CurrentAverageQuality";
    160       bestAverageWorstQualityCalculator1.BestQualityParameter.ActualName = "CurrentBestQuality";
    161       bestAverageWorstQualityCalculator1.MaximizationParameter.ActualName = "Maximization";
    162       bestAverageWorstQualityCalculator1.QualityParameter.ActualName = "Quality";
    163       bestAverageWorstQualityCalculator1.WorstQualityParameter.ActualName = "CurrentWorstQuality";
    164 
    165       dataTableValuesCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Best Quality", null, "CurrentBestQuality"));
    166       dataTableValuesCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Average Quality", null, "CurrentAverageQuality"));
    167       dataTableValuesCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Worst Quality", null, "CurrentWorstQuality"));
    168       dataTableValuesCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality"));
    169       dataTableValuesCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Known Quality", null, "BestKnownQuality"));
    170       dataTableValuesCollector1.DataTableParameter.ActualName = "Qualities";
    171 
    172       qualityDifferenceCalculator1.AbsoluteDifferenceParameter.ActualName = "AbsoluteDifferenceBestKnownToBest";
    173       qualityDifferenceCalculator1.FirstQualityParameter.ActualName = "BestKnownQuality";
    174       qualityDifferenceCalculator1.RelativeDifferenceParameter.ActualName = "RelativeDifferenceBestKnownToBest";
    175       qualityDifferenceCalculator1.SecondQualityParameter.ActualName = "BestQuality";
    176 
    177       visualizer1.Name = "Visualizer";
    178       visualizer1.OperatorParameter.ActualName = "Visualizer";
    179 
    180       resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));
    181       resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Best Quality", null, "CurrentBestQuality"));
    182       resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Average Quality", null, "CurrentAverageQuality"));
    183       resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Worst Quality", null, "CurrentWorstQuality"));
    184       resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality"));
    185       resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Known Quality", null, "BestKnownQuality"));
    186       resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Absolute Difference of Best Known Quality to Best Quality", null, "AbsoluteDifferenceBestKnownToBest"));
    187       resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Relative Difference of Best Known Quality to Best Quality", null, "RelativeDifferenceBestKnownToBest"));
    188       resultsCollector.CollectedValues.Add(new LookupParameter<IItem>("Solution Visualization", null, "Visualization"));
    189       resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>("Qualities"));
    190       resultsCollector.ResultsParameter.ActualName = "Results";
     134      resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));
     135      resultsCollector1.ResultsParameter.ActualName = "Results";
     136
     137      analyzer1.Name = "Analyzer";
     138      analyzer1.OperatorParameter.ActualName = "Analyzer";
    191139
    192140      selector.Name = "Selector";
     
    222170      comparator.RightSideParameter.ActualName = "MaximumGenerations";
    223171
    224       bestQualityMemorizer3.BestQualityParameter.ActualName = "BestQuality";
    225       bestQualityMemorizer3.MaximizationParameter.ActualName = "Maximization";
    226       bestQualityMemorizer3.QualityParameter.ActualName = "Quality";
    227 
    228       bestQualityMemorizer4.BestQualityParameter.ActualName = "BestKnownQuality";
    229       bestQualityMemorizer4.MaximizationParameter.ActualName = "Maximization";
    230       bestQualityMemorizer4.QualityParameter.ActualName = "Quality";
    231 
    232       bestAverageWorstQualityCalculator2.AverageQualityParameter.ActualName = "CurrentAverageQuality";
    233       bestAverageWorstQualityCalculator2.BestQualityParameter.ActualName = "CurrentBestQuality";
    234       bestAverageWorstQualityCalculator2.MaximizationParameter.ActualName = "Maximization";
    235       bestAverageWorstQualityCalculator2.QualityParameter.ActualName = "Quality";
    236       bestAverageWorstQualityCalculator2.WorstQualityParameter.ActualName = "CurrentWorstQuality";
    237 
    238       dataTableValuesCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Best Quality", null, "CurrentBestQuality"));
    239       dataTableValuesCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Average Quality", null, "CurrentAverageQuality"));
    240       dataTableValuesCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Worst Quality", null, "CurrentWorstQuality"));
    241       dataTableValuesCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality"));
    242       dataTableValuesCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Known Quality", null, "BestKnownQuality"));
    243       dataTableValuesCollector2.DataTableParameter.ActualName = "Qualities";
    244 
    245       qualityDifferenceCalculator2.AbsoluteDifferenceParameter.ActualName = "AbsoluteDifferenceBestKnownToBest";
    246       qualityDifferenceCalculator2.FirstQualityParameter.ActualName = "BestKnownQuality";
    247       qualityDifferenceCalculator2.RelativeDifferenceParameter.ActualName = "RelativeDifferenceBestKnownToBest";
    248       qualityDifferenceCalculator2.SecondQualityParameter.ActualName = "BestQuality";
    249 
    250       visualizer2.Name = "Visualizer";
    251       visualizer2.OperatorParameter.ActualName = "Visualizer";
     172      resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));
     173      resultsCollector2.ResultsParameter.ActualName = "Results";
     174
     175      analyzer2.Name = "Analyzer";
     176      analyzer2.OperatorParameter.ActualName = "Analyzer";
    252177
    253178      conditionalBranch.ConditionParameter.ActualName = "Terminate";
     
    256181      #region Create operator graph
    257182      OperatorGraph.InitialOperator = variableCreator;
    258       variableCreator.Successor = bestQualityMemorizer1;
    259       bestQualityMemorizer1.Successor = bestQualityMemorizer2;
    260       bestQualityMemorizer2.Successor = bestAverageWorstQualityCalculator1;
    261       bestAverageWorstQualityCalculator1.Successor = dataTableValuesCollector1;
    262       dataTableValuesCollector1.Successor = qualityDifferenceCalculator1;
    263       qualityDifferenceCalculator1.Successor = visualizer1;
    264       visualizer1.Successor = resultsCollector;
    265       resultsCollector.Successor = selector;
     183      variableCreator.Successor = resultsCollector1;
     184      resultsCollector1.Successor = analyzer1;
     185      analyzer1.Successor = selector;
    266186      selector.Successor = subScopesProcessor1;
    267187      subScopesProcessor1.Operators.Add(new EmptyOperator());
     
    285205      mergingReducer.Successor = intCounter;
    286206      intCounter.Successor = comparator;
    287       comparator.Successor = bestQualityMemorizer3;
    288       bestQualityMemorizer3.Successor = bestQualityMemorizer4;
    289       bestQualityMemorizer4.Successor = bestAverageWorstQualityCalculator2;
    290       bestAverageWorstQualityCalculator2.Successor = dataTableValuesCollector2;
    291       dataTableValuesCollector2.Successor = qualityDifferenceCalculator2;
    292       qualityDifferenceCalculator2.Successor = visualizer2;
    293       visualizer2.Successor = conditionalBranch;
     207      comparator.Successor = resultsCollector2;
     208      resultsCollector2.Successor = analyzer2;
     209      analyzer2.Successor = conditionalBranch;
    294210      conditionalBranch.FalseBranch = selector;
    295211      conditionalBranch.TrueBranch = null;
  • trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/IslandGeneticAlgorithm.cs

    r3609 r3616  
    271271      ParameterizeStochasticOperator(Problem.SolutionCreator);
    272272      ParameterizeStochasticOperator(Problem.Evaluator);
    273       ParameterizeStochasticOperator(Problem.Visualizer);
    274273      foreach (IOperator op in Problem.Operators) ParameterizeStochasticOperator(op);
    275274      ParameterizeSolutionsCreator();
     
    279278      UpdateMutators();
    280279      Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
    281       if (Problem.Visualizer != null) Problem.Visualizer.VisualizationParameter.ActualNameChanged += new EventHandler(Visualizer_VisualizationParameter_ActualNameChanged);
    282280      base.OnProblemChanged();
    283281    }
     
    295293      Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
    296294      base.Problem_EvaluatorChanged(sender, e);
    297     }
    298     protected override void Problem_VisualizerChanged(object sender, EventArgs e) {
    299       ParameterizeStochasticOperator(Problem.Visualizer);
    300       ParameterizeMainLoop();
    301       if (Problem.Visualizer != null) Problem.Visualizer.VisualizationParameter.ActualNameChanged += new EventHandler(Visualizer_VisualizationParameter_ActualNameChanged);
    302       base.Problem_VisualizerChanged(sender, e);
    303295    }
    304296    protected override void Problem_OperatorsChanged(object sender, EventArgs e) {
     
    325317      ParameterizeMainLoop();
    326318      ParameterizeSelectors();
    327     }
    328     private void Visualizer_VisualizationParameter_ActualNameChanged(object sender, EventArgs e) {
    329       ParameterizeMainLoop();
    330319    }
    331320    private void MigrationRateParameter_ValueChanged(object sender, EventArgs e) {
     
    355344        UpdateMutators();
    356345        Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
    357         if (Problem.Visualizer != null) Problem.Visualizer.VisualizationParameter.ActualNameChanged += new EventHandler(Visualizer_VisualizationParameter_ActualNameChanged);
    358346      }
    359347    }
     
    367355      MainLoop.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
    368356      MainLoop.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
    369       MainLoop.VisualizerParameter.ActualName = Problem.VisualizerParameter.Name;
    370       if (Problem.Visualizer != null)
    371         MainLoop.VisualizationParameter.ActualName = Problem.Visualizer.VisualizationParameter.ActualName;
    372357    }
    373358    private void ParameterizeStochasticOperator(IOperator op) {
  • trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/IslandGeneticAlgorithmMainLoop.cs

    r3611 r3616  
    100100      get { return (ValueLookupParameter<ResultCollection>)Parameters["Results"]; }
    101101    }
    102     public ValueLookupParameter<IOperator> VisualizerParameter {
    103       get { return (ValueLookupParameter<IOperator>)Parameters["Visualizer"]; }
    104     }
    105     public LookupParameter<IItem> VisualizationParameter {
    106       get { return (LookupParameter<IItem>)Parameters["Visualization"]; }
     102    public ValueLookupParameter<IOperator> AnalyzerParameter {
     103      get { return (ValueLookupParameter<IOperator>)Parameters["Analyzer"]; }
    107104    }
    108105    #endregion
     
    132129      Parameters.Add(new ValueLookupParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation."));
    133130      Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The results collection to store the results."));
    134       Parameters.Add(new ValueLookupParameter<IOperator>("Visualizer", "The operator used to visualize solutions."));
    135       Parameters.Add(new LookupParameter<IItem>("Visualization", "The item which represents the visualization of solutions."));
     131      Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to analyze each island."));
    136132      #endregion
    137133
     
    144140      DataTableValuesCollector islandDataTableValuesCollector1 = new DataTableValuesCollector();
    145141      QualityDifferenceCalculator islandQualityDifferenceCalculator1 = new QualityDifferenceCalculator();
    146       Placeholder islandVisualizer1 = new Placeholder();
     142      Placeholder islandAnalyzer1 = new Placeholder();
    147143      ResultsCollector islandResultsCollector = new ResultsCollector();
    148144      BestQualityMemorizer bestQualityMemorizer1 = new BestQualityMemorizer();
     
    170166      DataTableValuesCollector islandDataTableValuesCollector2 = new DataTableValuesCollector();
    171167      QualityDifferenceCalculator islandQualityDifferenceCalculator2 = new QualityDifferenceCalculator();
    172       Placeholder islandVisualizer2 = new Placeholder();
     168      Placeholder islandAnalyzer2 = new Placeholder();
    173169      IntCounter generationsCounter = new IntCounter();
    174170      IntCounter generationsSinceLastMigrationCounter = new IntCounter();
     
    218214      islandQualityDifferenceCalculator1.SecondQualityParameter.ActualName = "BestQuality";
    219215
    220       islandVisualizer1.Name = "Visualizer";
    221       islandVisualizer1.OperatorParameter.ActualName = "Visualizer";
     216      islandAnalyzer1.Name = "Analyzer";
     217      islandAnalyzer1.OperatorParameter.ActualName = "Analyzer";
    222218
    223219      islandResultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));
     
    229225      islandResultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Absolute Difference of Best Known Quality to Best Quality", null, "AbsoluteDifferenceBestKnownToBest"));
    230226      islandResultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Relative Difference of Best Known Quality to Best Quality", null, "RelativeDifferenceBestKnownToBest"));
    231       islandResultsCollector.CollectedValues.Add(new LookupParameter<IItem>("Solution Visualization", null, "Visualization"));
    232227      islandResultsCollector.CollectedValues.Add(new LookupParameter<DataTable>("Qualities"));
    233228      islandResultsCollector.ResultsParameter.ActualName = "IslandResults";
     
    317312      islandQualityDifferenceCalculator2.SecondQualityParameter.ActualName = "BestQuality";
    318313
    319       islandVisualizer2.Name = "Visualizer";
    320       islandVisualizer2.OperatorParameter.ActualName = "Visualizer";
     314      islandAnalyzer2.Name = "Analyzer";
     315      islandAnalyzer2.OperatorParameter.ActualName = "Analyzer";
    321316
    322317      generationsCounter.Name = "Generations + 1";
     
    399394      islandBestAverageWorstQualityCalculator1.Successor = islandDataTableValuesCollector1;
    400395      islandDataTableValuesCollector1.Successor = islandQualityDifferenceCalculator1;
    401       islandQualityDifferenceCalculator1.Successor = islandVisualizer1;
    402       islandVisualizer1.Successor = islandResultsCollector;
     396      islandQualityDifferenceCalculator1.Successor = islandAnalyzer1;
     397      islandAnalyzer1.Successor = islandResultsCollector;
    403398      bestQualityMemorizer1.Successor = bestQualityMemorizer2;
    404399      bestQualityMemorizer2.Successor = bestAverageWorstQualityCalculator1;
     
    432427      islandBestAverageWorstQualityCalculator2.Successor = islandDataTableValuesCollector2;
    433428      islandDataTableValuesCollector2.Successor = islandQualityDifferenceCalculator2;
    434       islandQualityDifferenceCalculator2.Successor = islandVisualizer2;
    435       islandVisualizer2.Successor = null;
     429      islandQualityDifferenceCalculator2.Successor = islandAnalyzer2;
     430      islandAnalyzer2.Successor = null;
    436431      generationsCounter.Successor = generationsSinceLastMigrationCounter;
    437432      generationsSinceLastMigrationCounter.Successor = migrationComparator;
  • trunk/sources/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearch.cs

    r3376 r3616  
    192192      base.Problem_EvaluatorChanged(sender, e);
    193193    }
    194     protected override void Problem_VisualizerChanged(object sender, EventArgs e) {
    195       ParameterizeStochasticOperator(Problem.Visualizer);
    196       ParameterizeMainLoop();
    197       if (Problem.Visualizer != null) Problem.Visualizer.VisualizationParameter.ActualNameChanged += new EventHandler(Visualizer_VisualizationParameter_ActualNameChanged);
    198       base.Problem_VisualizerChanged(sender, e);
    199     }
    200194    protected override void Problem_OperatorsChanged(object sender, EventArgs e) {
    201195      foreach (IOperator op in Problem.Operators) ParameterizeStochasticOperator(op);
     
    230224      ParameterizeMoveEvaluators();
    231225      ParameterizeMoveMakers();
    232     }
    233     private void Visualizer_VisualizationParameter_ActualNameChanged(object sender, EventArgs e) {
    234       ParameterizeMainLoop();
    235226    }
    236227    #endregion
     
    304295      if (MoveEvaluator != null)
    305296        MainLoop.MoveQualityParameter.ActualName = MoveEvaluator.MoveQualityParameter.ActualName;
    306       MainLoop.VisualizerParameter.ActualName = Problem.VisualizerParameter.Name;
    307       if (Problem.Visualizer != null)
    308         MainLoop.VisualizationParameter.ActualName = Problem.Visualizer.VisualizationParameter.ActualName;
    309297    }
    310298    private void ParameterizeStochasticOperator(IOperator op) {
  • trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithm.cs

    r3611 r3616  
    327327      ParameterizeStochasticOperator(Problem.SolutionCreator);
    328328      ParameterizeStochasticOperator(Problem.Evaluator);
    329       ParameterizeStochasticOperator(Problem.Visualizer);
    330329      foreach (IOperator op in Problem.Operators) ParameterizeStochasticOperator(op);
    331330      ParameterizeSolutionsCreator();
     
    335334      UpdateMutators();
    336335      Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
    337       if (Problem.Visualizer != null) Problem.Visualizer.VisualizationParameter.ActualNameChanged += new EventHandler(Visualizer_VisualizationParameter_ActualNameChanged);
    338336      base.OnProblemChanged();
    339337    }
     
    351349      Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
    352350      base.Problem_EvaluatorChanged(sender, e);
    353     }
    354     protected override void Problem_VisualizerChanged(object sender, EventArgs e) {
    355       ParameterizeStochasticOperator(Problem.Visualizer);
    356       ParameterizeMainLoop();
    357       if (Problem.Visualizer != null) Problem.Visualizer.VisualizationParameter.ActualNameChanged += new EventHandler(Visualizer_VisualizationParameter_ActualNameChanged);
    358       base.Problem_VisualizerChanged(sender, e);
    359351    }
    360352    protected override void Problem_OperatorsChanged(object sender, EventArgs e) {
     
    381373      ParameterizeMainLoop();
    382374      ParameterizeSelectors();
    383     }
    384     private void Visualizer_VisualizationParameter_ActualNameChanged(object sender, EventArgs e) {
    385       ParameterizeMainLoop();
    386375    }
    387376    private void MigrationRateParameter_ValueChanged(object sender, EventArgs e) {
     
    431420        UpdateMutators();
    432421        Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
    433         if (Problem.Visualizer != null) Problem.Visualizer.VisualizationParameter.ActualNameChanged += new EventHandler(Visualizer_VisualizationParameter_ActualNameChanged);
    434422      }
    435423    }
     
    443431      MainLoop.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
    444432      MainLoop.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
    445       MainLoop.VisualizerParameter.ActualName = Problem.VisualizerParameter.Name;
    446       if (Problem.Visualizer != null)
    447         MainLoop.VisualizationParameter.ActualName = Problem.Visualizer.VisualizationParameter.ActualName;
    448433    }
    449434    private void ParameterizeStochasticOperator(IOperator op) {
  • trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithm.cs

    r3510 r3616  
    246246      ParameterizeStochasticOperator(Problem.SolutionCreator);
    247247      ParameterizeStochasticOperator(Problem.Evaluator);
    248       ParameterizeStochasticOperator(Problem.Visualizer);
    249248      foreach (IOperator op in Problem.Operators) ParameterizeStochasticOperator(op);
    250249      ParameterizeSolutionsCreator();
     
    254253      UpdateMutators();
    255254      Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
    256       if (Problem.Visualizer != null) Problem.Visualizer.VisualizationParameter.ActualNameChanged += new EventHandler(Visualizer_VisualizationParameter_ActualNameChanged);
    257255      base.OnProblemChanged();
    258256    }
     
    270268      Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
    271269      base.Problem_EvaluatorChanged(sender, e);
    272     }
    273     protected override void Problem_VisualizerChanged(object sender, EventArgs e) {
    274       ParameterizeStochasticOperator(Problem.Visualizer);
    275       ParameterizMainLoop();
    276       if (Problem.Visualizer != null) Problem.Visualizer.VisualizationParameter.ActualNameChanged += new EventHandler(Visualizer_VisualizationParameter_ActualNameChanged);
    277       base.Problem_VisualizerChanged(sender, e);
    278270    }
    279271    protected override void Problem_OperatorsChanged(object sender, EventArgs e) {
     
    300292      ParameterizMainLoop();
    301293      ParameterizeSelectors();
    302     }
    303     private void Visualizer_VisualizationParameter_ActualNameChanged(object sender, EventArgs e) {
    304       ParameterizMainLoop();
    305294    }
    306295    #endregion
     
    321310        UpdateMutators();
    322311        Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
    323         if (Problem.Visualizer != null) Problem.Visualizer.VisualizationParameter.ActualNameChanged += new EventHandler(Visualizer_VisualizationParameter_ActualNameChanged);
    324312      }
    325313    }
     
    333321      MainLoop.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
    334322      MainLoop.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
    335       MainLoop.VisualizerParameter.ActualName = Problem.VisualizerParameter.Name;
    336       if (Problem.Visualizer != null)
    337         MainLoop.VisualizationParameter.ActualName = Problem.Visualizer.VisualizationParameter.ActualName;
    338323    }
    339324    private void ParameterizeStochasticOperator(IOperator op) {
  • trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASA.cs

    r3510 r3616  
    295295      ParameterizeStochasticOperator(Problem.SolutionCreator);
    296296      ParameterizeStochasticOperator(Problem.Evaluator);
    297       ParameterizeStochasticOperator(Problem.Visualizer);
    298297      foreach (IOperator op in Problem.Operators) ParameterizeStochasticOperator(op);
    299298      ParameterizeSolutionsCreator();
     
    303302      UpdateMutators();
    304303      Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
    305       if (Problem.Visualizer != null) Problem.Visualizer.VisualizationParameter.ActualNameChanged += new EventHandler(Visualizer_VisualizationParameter_ActualNameChanged);
    306304      base.OnProblemChanged();
    307305    }
     
    319317      Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
    320318      base.Problem_EvaluatorChanged(sender, e);
    321     }
    322     protected override void Problem_VisualizerChanged(object sender, EventArgs e) {
    323       ParameterizeStochasticOperator(Problem.Visualizer);
    324       ParameterizeMainLoop();
    325       if (Problem.Visualizer != null) Problem.Visualizer.VisualizationParameter.ActualNameChanged += new EventHandler(Visualizer_VisualizationParameter_ActualNameChanged);
    326       base.Problem_VisualizerChanged(sender, e);
    327319    }
    328320    protected override void Problem_OperatorsChanged(object sender, EventArgs e) {
     
    349341      ParameterizeMainLoop();
    350342      ParameterizeSelectors();
    351     }
    352     private void Visualizer_VisualizationParameter_ActualNameChanged(object sender, EventArgs e) {
    353       ParameterizeMainLoop();
    354343    }
    355344    private void MaximumGenerationsParameter_ValueChanged(object sender, EventArgs e) {
     
    391380        UpdateMutators();
    392381        Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
    393         if (Problem.Visualizer != null) Problem.Visualizer.VisualizationParameter.ActualNameChanged += new EventHandler(Visualizer_VisualizationParameter_ActualNameChanged);
    394382      }
    395383    }
     
    403391      MainLoop.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
    404392      MainLoop.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
    405       MainLoop.VisualizerParameter.ActualName = Problem.VisualizerParameter.Name;
    406393      MainLoop.MigrationIntervalParameter.Value = new IntValue(MaximumGenerations.Value / NumberOfVillages.Value);
    407       if (Problem.Visualizer != null)
    408         MainLoop.VisualizationParameter.ActualName = Problem.Visualizer.VisualizationParameter.ActualName;
    409394    }
    410395    private void ParameterizeStochasticOperator(IOperator op) {
  • trunk/sources/HeuristicLab.Algorithms.SimulatedAnnealing/3.3/SimulatedAnnealing.cs

    r3376 r3616  
    221221      base.Problem_EvaluatorChanged(sender, e);
    222222    }
    223     protected override void Problem_VisualizerChanged(object sender, EventArgs e) {
    224       ParameterizeStochasticOperator(Problem.Visualizer);
    225       ParameterizeMainLoop();
    226       if (Problem.Visualizer != null) Problem.Visualizer.VisualizationParameter.ActualNameChanged += new EventHandler(Visualizer_VisualizationParameter_ActualNameChanged);
    227       base.Problem_VisualizerChanged(sender, e);
    228     }
    229223    protected override void Problem_OperatorsChanged(object sender, EventArgs e) {
    230224      foreach (IOperator op in Problem.Operators) ParameterizeStochasticOperator(op);
     
    260254      ParameterizeMoveEvaluators();
    261255      ParameterizeMoveMakers();
    262     }
    263     private void Visualizer_VisualizationParameter_ActualNameChanged(object sender, EventArgs e) {
    264       ParameterizeMainLoop();
    265256    }
    266257    #endregion
     
    343334      if (MoveEvaluator != null)
    344335        MainLoop.MoveQualityParameter.ActualName = MoveEvaluator.MoveQualityParameter.ActualName;
    345       MainLoop.VisualizerParameter.ActualName = Problem.VisualizerParameter.Name;
    346       if (Problem.Visualizer != null)
    347         MainLoop.VisualizationParameter.ActualName = Problem.Visualizer.VisualizationParameter.ActualName;
    348336    }
    349337    private void ParameterizeStochasticOperator(IOperator op) {
  • trunk/sources/HeuristicLab.Algorithms.TabuSearch/3.3/TabuSearch.cs

    r3376 r3616  
    223223      base.Problem_EvaluatorChanged(sender, e);
    224224    }
    225     protected override void Problem_VisualizerChanged(object sender, EventArgs e) {
    226       ParameterizeStochasticOperator(Problem.Visualizer);
    227       ParameterizeMainLoop();
    228       if (Problem.Visualizer != null) Problem.Visualizer.VisualizationParameter.ActualNameChanged += new EventHandler(Visualizer_VisualizationParameter_ActualNameChanged);
    229       base.Problem_VisualizerChanged(sender, e);
    230     }
    231225    protected override void Problem_OperatorsChanged(object sender, EventArgs e) {
    232226      foreach (IOperator op in Problem.Operators) ParameterizeStochasticOperator(op);
     
    281275      ParameterizeMainLoop();
    282276    }
    283     private void Visualizer_VisualizationParameter_ActualNameChanged(object sender, EventArgs e) {
    284       ParameterizeMainLoop();
    285     }
    286277    private void SampleSizeParameter_NameChanged(object sender, EventArgs e) {
    287278      ParameterizeMoveGenerators();
     
    297288          op.MoveQualityParameter.ActualNameChanged += new EventHandler(MoveEvaluator_MoveQualityParameter_ActualNameChanged);
    298289        }
    299         if (Problem.Visualizer != null) Problem.Visualizer.VisualizationParameter.ActualNameChanged += new EventHandler(Visualizer_VisualizationParameter_ActualNameChanged);
    300290      }
    301291      MoveGeneratorParameter.ValueChanged += new EventHandler(MoveGeneratorParameter_ValueChanged);
     
    377367      if (TabuChecker != null)
    378368        MainLoop.MoveTabuParameter.ActualName = TabuChecker.MoveTabuParameter.ActualName;
    379       MainLoop.VisualizerParameter.ActualName = Problem.VisualizerParameter.Name;
    380       if (Problem.Visualizer != null)
    381         MainLoop.VisualizationParameter.ActualName = Problem.Visualizer.VisualizationParameter.ActualName;
    382369    }
    383370    private void ParameterizeStochasticOperator(IOperator op) {
  • trunk/sources/HeuristicLab.Analysis/3.3/HeuristicLab.Analysis-3.3.csproj

    r3384 r3616  
    8585  <ItemGroup>
    8686    <None Include="HeuristicLabAnalysisPlugin.cs.frame" />
     87    <Compile Include="BestAverageWorstQualityAnalyzer.cs" />
    8788    <Compile Include="BestAverageWorstQualityCalculator.cs" />
    8889    <Compile Include="BestQualityMemorizer.cs" />
     90    <Compile Include="MultiAnalyzer.cs" />
    8991    <Compile Include="QualityDifferenceCalculator.cs" />
    9092    <Compile Include="DataRow.cs" />
     
    125127      <Name>HeuristicLab.Operators-3.3</Name>
    126128    </ProjectReference>
     129    <ProjectReference Include="..\..\HeuristicLab.Optimization.Operators\3.3\HeuristicLab.Optimization.Operators-3.3.csproj">
     130      <Project>{25087811-F74C-4128-BC86-8324271DA13E}</Project>
     131      <Name>HeuristicLab.Optimization.Operators-3.3</Name>
     132    </ProjectReference>
     133    <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
     134      <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>
     135      <Name>HeuristicLab.Optimization-3.3</Name>
     136    </ProjectReference>
    127137    <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj">
    128138      <Project>{56F9106A-079F-4C61-92F6-86A84C2D84B7}</Project>
  • trunk/sources/HeuristicLab.Analysis/3.3/HeuristicLabAnalysisPlugin.cs.frame

    r3384 r3616  
    3434  [PluginDependency("HeuristicLab.Data", "3.3")]
    3535  [PluginDependency("HeuristicLab.Operators", "3.3")]
     36  [PluginDependency("HeuristicLab.Optimization", "3.3")]
     37  [PluginDependency("HeuristicLab.Optimization.Operators", "3.3")]
    3638  [PluginDependency("HeuristicLab.Parameters", "3.3")]
    3739  [PluginDependency("HeuristicLab.Persistence", "3.3")]
  • trunk/sources/HeuristicLab.Operators/3.3/CheckedMultiOperator.cs

    r3591 r3616  
    3131namespace HeuristicLab.Operators {
    3232  /// <summary>
    33   /// A base class for operators which apply arbitrary many other operators of a specific type, operators can be checked/unchecked.
     33  /// A base class for operators which apply arbitrary many other operators of a specific type that can be checked or unchecked.
    3434  /// </summary>
    35   [Item("CheckedMultiOperator<T>", "A base class for operators which apply arbitrary many other operators of a specific type.")]
     35  [Item("CheckedMultiOperator<T>", "A base class for operators which apply arbitrary many other operators of a specific type that can be checked or unchecked.")]
    3636  [StorableClass]
    3737  public abstract class CheckedMultiOperator<T> : MultiOperator<T> where T : class, IOperator {
  • trunk/sources/HeuristicLab.Optimization/3.3/Algorithm.cs

    r3372 r3616  
    255255      problem.SolutionCreatorChanged -= new EventHandler(Problem_SolutionCreatorChanged);
    256256      problem.EvaluatorChanged -= new EventHandler(Problem_EvaluatorChanged);
    257       problem.VisualizerChanged -= new EventHandler(Problem_VisualizerChanged);
    258257      problem.OperatorsChanged -= new EventHandler(Problem_OperatorsChanged);
    259258    }
     
    261260      problem.SolutionCreatorChanged += new EventHandler(Problem_SolutionCreatorChanged);
    262261      problem.EvaluatorChanged += new EventHandler(Problem_EvaluatorChanged);
    263       problem.VisualizerChanged += new EventHandler(Problem_VisualizerChanged);
    264262      problem.OperatorsChanged += new EventHandler(Problem_OperatorsChanged);
    265263    }
     
    267265    protected virtual void Problem_SolutionCreatorChanged(object sender, EventArgs e) { }
    268266    protected virtual void Problem_EvaluatorChanged(object sender, EventArgs e) { }
    269     protected virtual void Problem_VisualizerChanged(object sender, EventArgs e) { }
    270267    protected virtual void Problem_OperatorsChanged(object sender, EventArgs e) { }
    271268    #endregion
  • trunk/sources/HeuristicLab.Optimization/3.3/HeuristicLab.Optimization-3.3.csproj

    r3614 r3616  
    8787    <Compile Include="Algorithm.cs" />
    8888    <Compile Include="BatchRun.cs" />
     89    <Compile Include="Interfaces\IAnalyzer.cs" />
    8990    <Compile Include="RunCollectionComparisonConstraint.cs" />
    9091    <Compile Include="RunCollectionConstraintCollection.cs" />
     
    107108    <Compile Include="RunCollection.cs" />
    108109    <Compile Include="Run.cs" />
    109     <Compile Include="Interfaces\IMultiObjectiveSolutionsVisualizer.cs" />
    110110    <Compile Include="Interfaces\IResult.cs" />
    111     <Compile Include="Interfaces\ISingleObjectiveSolutionsVisualizer.cs" />
    112     <Compile Include="Interfaces\ISolutionsVisualizer.cs" />
    113111    <Compile Include="Interfaces\IDiscreteDoubleValueModifier.cs" />
    114112    <Compile Include="Interfaces\IExhaustiveMoveGenerator.cs" />
  • trunk/sources/HeuristicLab.Optimization/3.3/Interfaces/IAnalyzer.cs

    r3612 r3616  
    2020#endregion
    2121
    22 using HeuristicLab.Common;
    2322using HeuristicLab.Core;
    2423
    2524namespace HeuristicLab.Optimization {
    2625  /// <summary>
    27   /// An interface which represents an operator for visualizing solutions.
     26  /// An interface which represents an analysis operator.
    2827  /// </summary>
    29   public interface ISolutionsVisualizer : IOperator {
    30     ILookupParameter VisualizationParameter { get; }
    31   }
     28  public interface IAnalyzer : IOperator { }
    3229}
  • trunk/sources/HeuristicLab.Optimization/3.3/Interfaces/IProblem.cs

    r3376 r3616  
    3434    IParameter EvaluatorParameter { get; }
    3535    IEvaluator Evaluator { get; }
    36     IParameter VisualizerParameter { get; }
    37     ISolutionsVisualizer Visualizer { get; }
    3836    IEnumerable<IOperator> Operators { get; }
    3937
    4038    event EventHandler SolutionCreatorChanged;
    4139    event EventHandler EvaluatorChanged;
    42     event EventHandler VisualizerChanged;
    4340    event EventHandler OperatorsChanged;
    4441  }
  • trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/ArtificialAntProblem.cs

    r3539 r3616  
    125125    }
    126126
    127     public OptionalValueParameter<ISingleObjectiveSolutionsVisualizer> VisualizerParameter {
    128       get { return (OptionalValueParameter<ISingleObjectiveSolutionsVisualizer>)Parameters["Visualizer"]; }
    129     }
    130     IParameter IProblem.VisualizerParameter {
    131       get { return VisualizerParameter; }
    132     }
    133127    public ValueParameter<DoubleValue> BestKnownQualityParameter {
    134128      get { return (ValueParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
     
    184178      get { return (GlobalSymbolicExpressionGrammar)ArtificialAntExpressionGrammarParameter.Value; }
    185179    }
    186     public ISingleObjectiveSolutionsVisualizer Visualizer {
    187       get { return VisualizerParameter.Value; }
    188       set { VisualizerParameter.Value = value; }
    189     }
    190     ISolutionsVisualizer IProblem.Visualizer {
    191       get { return VisualizerParameter.Value; }
    192     }
    193180    public DoubleValue BestKnownQuality {
    194181      get { return BestKnownQualityParameter.Value; }
     
    204191      SymbolicExpressionTreeCreator creator = new ProbabilisticTreeCreator();
    205192      Evaluator evaluator = new Evaluator();
    206       BestAntTrailVisualizer visualizer = new BestAntTrailVisualizer();
    207193      BoolMatrix world = new BoolMatrix(santaFeAntTrail);
    208194      ISymbolicExpressionGrammar grammar = new GlobalSymbolicExpressionGrammar(new ArtificialAntExpressionGrammar());
     
    218204      Parameters.Add(new ValueParameter<BoolMatrix>("World", "The world for the artificial ant with scattered food items.", world));
    219205      Parameters.Add(new ValueParameter<IntValue>("MaxTimeSteps", "The number of time steps the artificial ant has available to collect all food items.", new IntValue(600)));
    220       Parameters.Add(new ValueParameter<ISingleObjectiveSolutionsVisualizer>("Visualizer", "The operator which should be used to visualize artificial ant solutions.", visualizer));
    221206
    222207      creator.SymbolicExpressionTreeParameter.ActualName = "AntTrailSolution";
     
    251236        changed(this, EventArgs.Empty);
    252237    }
    253     public event EventHandler VisualizerChanged;
    254     private void OnVisualizerChanged() {
    255       var changed = VisualizerChanged;
    256       if (changed != null)
    257         changed(this, EventArgs.Empty);
    258     }
    259238
    260239    public event EventHandler OperatorsChanged;
     
    283262      ParameterizeVisualizer();
    284263      OnEvaluatorChanged();
    285     }
    286 
    287     private void VisualizerParameter_ValueChanged(object sender, EventArgs e) {
    288       ParameterizeVisualizer();
    289       OnVisualizerChanged();
    290264    }
    291265
     
    304278      EvaluatorParameter.ValueChanged += new EventHandler(EvaluatorParameter_ValueChanged);
    305279      Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
    306       VisualizerParameter.ValueChanged += new EventHandler(VisualizerParameter_ValueChanged);
    307280      MaxFunctionArgumentsParameter.ValueChanged += new EventHandler(MaxFunctionArgumentsParameter_ValueChanged);
    308281      MaxFunctionArguments.ValueChanged += new EventHandler(MaxFunctionArgumentsParameter_ValueChanged);
     
    336309    }
    337310    private void ParameterizeVisualizer() {
    338       if (Visualizer != null) {
    339         Visualizer.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
    340         var antTrailVisualizer = Visualizer as IAntTrailVisualizer;
    341         if (antTrailVisualizer != null) {
    342           antTrailVisualizer.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
    343           antTrailVisualizer.WorldParameter.ActualName = WorldParameter.Name;
    344           antTrailVisualizer.MaxTimeStepsParameter.ActualName = MaxTimeStepsParameter.Name;
    345         }
    346         var bestSymExpressionVisualizer = Visualizer as BestSymbolicExpressionTreeVisualizer;
    347         if (bestSymExpressionVisualizer != null) {
    348           bestSymExpressionVisualizer.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
    349         }
    350       }
     311      //if (Visualizer != null) {
     312      //  Visualizer.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
     313      //  var antTrailVisualizer = Visualizer as IAntTrailVisualizer;
     314      //  if (antTrailVisualizer != null) {
     315      //    antTrailVisualizer.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
     316      //    antTrailVisualizer.WorldParameter.ActualName = WorldParameter.Name;
     317      //    antTrailVisualizer.MaxTimeStepsParameter.ActualName = MaxTimeStepsParameter.Name;
     318      //  }
     319      //  var bestSymExpressionVisualizer = Visualizer as BestSymbolicExpressionTreeVisualizer;
     320      //  if (bestSymExpressionVisualizer != null) {
     321      //    bestSymExpressionVisualizer.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
     322      //  }
     323      //}
    351324    }
    352325
  • trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/BestAntTrailVisualizer.cs

    r3376 r3616  
    5353      get { return (ILookupParameter<AntTrail>)Parameters["AntTrail"]; }
    5454    }
    55     ILookupParameter ISolutionsVisualizer.VisualizationParameter {
    56       get { return AntTrailParameter; }
    57     }
    5855
    5956    public BestAntTrailVisualizer()
  • trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/BestSymbolicExpressionTreeVisualizer.cs

    r3376 r3616  
    3636  [Item("BestSymbolicExpressionTreeVisualizer", "An operator for visualizing the best symbolic expression tree of an artificial ant problem.")]
    3737  [StorableClass]
    38   public sealed class BestSymbolicExpressionTreeVisualizer : SingleSuccessorOperator, ISingleObjectiveSolutionsVisualizer, ISolutionsVisualizer {
     38  public sealed class BestSymbolicExpressionTreeVisualizer : SingleSuccessorOperator, IAnalyzer {
    3939    public ILookupParameter<ItemArray<SymbolicExpressionTree>> SymbolicExpressionTreeParameter {
    4040      get { return (ILookupParameter<ItemArray<SymbolicExpressionTree>>)Parameters["SymbolicExpressionTree"]; }
     
    4545    public ILookupParameter<SymbolicExpressionTree> BestSymbolicExpressionTreeParameter {
    4646      get { return (ILookupParameter<SymbolicExpressionTree>)Parameters["BestSymbolicExpressionTree"]; }
    47     }
    48     ILookupParameter ISolutionsVisualizer.VisualizationParameter {
    49       get { return BestSymbolicExpressionTreeParameter; }
    5047    }
    5148
  • trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/IAntTrailVisualizer.cs

    r3376 r3616  
    2828
    2929namespace HeuristicLab.Problems.ArtificialAnt {
    30   public interface IAntTrailVisualizer : ISolutionsVisualizer, ISingleObjectiveSolutionsVisualizer {
     30  public interface IAntTrailVisualizer : IAnalyzer {
    3131    ILookupParameter<ItemArray<SymbolicExpressionTree>> SymbolicExpressionTreeParameter { get; }
    3232    ILookupParameter<BoolMatrix> WorldParameter { get; }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/BestValidationSymbolicRegressionSolutionVisualizer.cs

    r3549 r3616  
    4242  [Item("BestSymbolicExpressionTreeVisualizer", "An operator for visualizing the best symbolic regression solution based on the validation set.")]
    4343  [StorableClass]
    44   public sealed class BestValidationSymbolicRegressionSolutionVisualizer : SingleSuccessorOperator, ISingleObjectiveSolutionsVisualizer, ISolutionsVisualizer {
     44  public sealed class BestValidationSymbolicRegressionSolutionVisualizer : SingleSuccessorOperator, IAnalyzer {
    4545    private const string SymbolicExpressionTreeInterpreterParameterName = "SymbolicExpressionTreeInterpreter";
    4646    private const string UpperEstimationLimitParameterName = "UpperEstimationLimit";
     
    8888    public ILookupParameter<SymbolicRegressionSolution> BestValidationSolutionParameter {
    8989      get { return (ILookupParameter<SymbolicRegressionSolution>)Parameters[BestValidationSolutionParameterName]; }
    90     }
    91     ILookupParameter ISolutionsVisualizer.VisualizationParameter {
    92       get { return BestValidationSolutionParameter; }
    9390    }
    9491
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionProblem.cs

    r3599 r3616  
    8989      get { return (ValueParameter<IntValue>)Parameters["MaxFunctionArguments"]; }
    9090    }
    91     public OptionalValueParameter<ISingleObjectiveSolutionsVisualizer> VisualizerParameter {
    92       get { return (OptionalValueParameter<ISingleObjectiveSolutionsVisualizer>)Parameters["Visualizer"]; }
    93     }
    94     IParameter IProblem.VisualizerParameter {
    95       get { return VisualizerParameter; }
    96     }
    9791    public OptionalValueParameter<DoubleValue> BestKnownQualityParameter {
    9892      get { return (OptionalValueParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
     
    152146    public ISymbolicExpressionGrammar FunctionTreeGrammar {
    153147      get { return (ISymbolicExpressionGrammar)FunctionTreeGrammarParameter.Value; }
    154     }
    155     public ISingleObjectiveSolutionsVisualizer Visualizer {
    156       get { return VisualizerParameter.Value; }
    157       set { VisualizerParameter.Value = value; }
    158     }
    159     ISolutionsVisualizer IProblem.Visualizer {
    160       get { return VisualizerParameter.Value; }
    161148    }
    162149    public DoubleValue BestKnownQuality {
     
    207194      Parameters.Add(new ValueParameter<IntValue>("MaxFunctionDefiningBranches", "Maximal number of automatically defined functions.", (IntValue)new IntValue(0).AsReadOnly()));
    208195      Parameters.Add(new ValueParameter<IntValue>("MaxFunctionArguments", "Maximal number of arguments of automatically defined functions.", (IntValue)new IntValue(0).AsReadOnly()));
    209       Parameters.Add(new ValueParameter<ISingleObjectiveSolutionsVisualizer>("Visualizer", "The operator which should be used to visualize symbolic regression solutions.", visualizer));
    210196
    211197      creator.SymbolicExpressionTreeParameter.ActualName = "SymbolicRegressionModel";
     
    240226      SolutionCreatorParameter.ValueChanged += new EventHandler(SolutionCreatorParameter_ValueChanged);
    241227      EvaluatorParameter.ValueChanged += new EventHandler(EvaluatorParameter_ValueChanged);
    242       VisualizerParameter.ValueChanged += new EventHandler(VisualizerParameter_ValueChanged);
    243228    }
    244229
     
    288273      ParameterizeVisualizer();
    289274    }
    290     protected virtual void OnVisualizerChanged(EventArgs e) {
    291       ParameterizeVisualizer();
    292       RaiseVisualizerChanged(e);
    293     }
    294275    #endregion
    295276
     
    303284    private void EvaluatorParameter_ValueChanged(object sender, EventArgs e) {
    304285      OnEvaluatorChanged(e);
    305     }
    306     private void VisualizerParameter_ValueChanged(object sender, EventArgs e) {
    307       OnVisualizerChanged(e);
    308286    }
    309287    private void ArchitectureParameter_ValueChanged(object sender, EventArgs e) {
     
    325303    private void RaiseEvaluatorChanged(EventArgs e) {
    326304      var changed = EvaluatorChanged;
    327       if (changed != null)
    328         changed(this, e);
    329     }
    330     public event EventHandler VisualizerChanged;
    331     private void RaiseVisualizerChanged(EventArgs e) {
    332       var changed = VisualizerChanged;
    333305      if (changed != null)
    334306        changed(this, e);
     
    394366
    395367    private void ParameterizeVisualizer() {
    396       var solutionVisualizer = Visualizer as BestValidationSymbolicRegressionSolutionVisualizer;
    397       if (solutionVisualizer != null) {
    398         solutionVisualizer.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
    399         solutionVisualizer.DataAnalysisProblemDataParameter.ActualName = DataAnalysisProblemDataParameter.Name;
    400         solutionVisualizer.UpperEstimationLimitParameter.ActualName = UpperEstimationLimitParameter.Name;
    401         solutionVisualizer.LowerEstimationLimitParameter.ActualName = LowerEstimationLimitParameter.Name;
    402         solutionVisualizer.QualityParameter.ActualName = Evaluator.QualityParameter.Name;
    403         solutionVisualizer.SymbolicExpressionTreeInterpreterParameter.ActualName = SymbolicExpressionTreeInterpreterParameter.Name;
    404         solutionVisualizer.ValidationSamplesStartParameter.Value = ValidationSamplesStart;
    405         solutionVisualizer.ValidationSamplesEndParameter.Value = ValidationSamplesEnd;
    406       }
     368      //var solutionVisualizer = Visualizer as BestValidationSymbolicRegressionSolutionVisualizer;
     369      //if (solutionVisualizer != null) {
     370      //  solutionVisualizer.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
     371      //  solutionVisualizer.DataAnalysisProblemDataParameter.ActualName = DataAnalysisProblemDataParameter.Name;
     372      //  solutionVisualizer.UpperEstimationLimitParameter.ActualName = UpperEstimationLimitParameter.Name;
     373      //  solutionVisualizer.LowerEstimationLimitParameter.ActualName = LowerEstimationLimitParameter.Name;
     374      //  solutionVisualizer.QualityParameter.ActualName = Evaluator.QualityParameter.Name;
     375      //  solutionVisualizer.SymbolicExpressionTreeInterpreterParameter.ActualName = SymbolicExpressionTreeInterpreterParameter.Name;
     376      //  solutionVisualizer.ValidationSamplesStartParameter.Value = ValidationSamplesStart;
     377      //  solutionVisualizer.ValidationSamplesEndParameter.Value = ValidationSamplesEnd;
     378      //}
    407379    }
    408380
  • trunk/sources/HeuristicLab.Problems.Knapsack/3.3/Interfaces/IKnapsackSolutionsVisualizer.cs

    r3467 r3616  
    2929  /// An interface which represents an operator for visualizing solutions of Knapsack Problems.
    3030  /// </summary>
    31   public interface IKnapsackSolutionsVisualizer : ISingleObjectiveSolutionsVisualizer {
     31  public interface IKnapsackSolutionsVisualizer : IAnalyzer {
    3232    ILookupParameter<ItemArray<BinaryVector>> BinaryVectorParameter { get; }
    3333    ILookupParameter<IntValue> KnapsackCapacityParameter { get; }
  • trunk/sources/HeuristicLab.Problems.Knapsack/3.3/KnapsackProblem.cs

    r3537 r3616  
    7474      get { return EvaluatorParameter; }
    7575    }
    76     public OptionalValueParameter<IKnapsackSolutionsVisualizer> VisualizerParameter {
    77       get { return (OptionalValueParameter<IKnapsackSolutionsVisualizer>)Parameters["Visualizer"]; }
    78     }
    79     IParameter IProblem.VisualizerParameter {
    80       get { return VisualizerParameter; }
    81     } 
    8276    public OptionalValueParameter<DoubleValue> BestKnownQualityParameter {
    8377      get { return (OptionalValueParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
     
    122116      get { return EvaluatorParameter.Value; }
    123117    }
    124     public IKnapsackSolutionsVisualizer Visualizer {
    125       get { return VisualizerParameter.Value; }
    126       set { VisualizerParameter.Value = value; }
    127     }
    128     ISolutionsVisualizer IProblem.Visualizer {
    129       get { return VisualizerParameter.Value; }
    130     }
    131118    public DoubleValue BestKnownQuality {
    132119      get { return BestKnownQualityParameter.Value; }
     
    165152      RandomBinaryVectorCreator creator = new RandomBinaryVectorCreator();
    166153      KnapsackEvaluator evaluator = new KnapsackEvaluator();
    167       IKnapsackSolutionsVisualizer visualizer = new BestKnapsackVisualizer();
    168154
    169155      Parameters.Add(new ValueParameter<BoolValue>("Maximization", "Set to true as the Knapsack Problem is a maximization problem.", new BoolValue(true)));
     
    175161      Parameters.Add(new ValueParameter<IKnapsackEvaluator>("Evaluator", "The operator which should be used to evaluate Knapsack solutions.", evaluator));
    176162      Parameters.Add(new OptionalValueParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this Knapsack instance."));
    177       Parameters.Add(new ValueParameter<IKnapsackSolutionsVisualizer>("Visualizer", "The operator which should be used to visualize Knapsack solutions.", visualizer));
    178163
    179164      creator.BinaryVectorParameter.ActualName = "KnapsackSolution";
     
    208193        EvaluatorChanged(this, EventArgs.Empty);
    209194    }
    210     public event EventHandler VisualizerChanged;
    211     private void OnVisualizerChanged() {
    212       if (VisualizerChanged != null)
    213         VisualizerChanged(this, EventArgs.Empty);
    214     }
    215195
    216196    public event EventHandler OperatorsChanged;
     
    270250    void PenaltyParameter_ValueChanged(object sender, EventArgs e) {
    271251      ParameterizeEvaluator();
    272     }
    273     void VisualizerParameter_ValueChanged(object sender, EventArgs e) {
    274       OnVisualizerChanged();
    275252    }
    276253    void OneBitflipMoveParameter_ActualNameChanged(object sender, EventArgs e) {
     
    295272      ValuesParameter.Value.Reset += new EventHandler(ValuesValue_Reset);
    296273      PenaltyParameter.ValueChanged += new EventHandler(PenaltyParameter_ValueChanged);
    297       VisualizerParameter.ValueChanged += new EventHandler(VisualizerParameter_ValueChanged);
    298274    }
    299275    private void ParameterizeSolutionCreator() {
     
    314290    }
    315291    private void ParameterizeVisualizer() {
    316       if (Visualizer is IKnapsackSolutionsVisualizer) {
    317         IKnapsackSolutionsVisualizer visualizer =
    318           (IKnapsackSolutionsVisualizer)Visualizer;
    319         visualizer.BinaryVectorParameter.ActualName = SolutionCreator.BinaryVectorParameter.ActualName;
    320         visualizer.KnapsackCapacityParameter.ActualName = KnapsackCapacityParameter.Name;
    321         visualizer.WeightsParameter.ActualName = WeightsParameter.Name;
    322         visualizer.ValuesParameter.ActualName = ValuesParameter.Name;
    323       }
     292      //if (Visualizer is IKnapsackSolutionsVisualizer) {
     293      //  IKnapsackSolutionsVisualizer visualizer =
     294      //    (IKnapsackSolutionsVisualizer)Visualizer;
     295      //  visualizer.BinaryVectorParameter.ActualName = SolutionCreator.BinaryVectorParameter.ActualName;
     296      //  visualizer.KnapsackCapacityParameter.ActualName = KnapsackCapacityParameter.Name;
     297      //  visualizer.WeightsParameter.ActualName = WeightsParameter.Name;
     298      //  visualizer.ValuesParameter.ActualName = ValuesParameter.Name;
     299      //}
    324300    }
    325301    private void InitializeOperators() {
  • trunk/sources/HeuristicLab.Problems.Knapsack/3.3/Visualizers/BestKnapsackVisualizer.cs

    r3467 r3616  
    5959    }
    6060
    61     ILookupParameter ISolutionsVisualizer.VisualizationParameter {
    62       get { return KnapsackSolutionParameter; }
    63     }
    64 
    6561    public BestKnapsackVisualizer()
    6662      : base() {
  • trunk/sources/HeuristicLab.Problems.OneMax/3.3/Interfaces/IOneMaxSolutionsVisualizer.cs

    r3115 r3616  
    2626  /// An interface which represents an operator for visualizing solutions of OneMax Problems.
    2727  /// </summary>
    28   public interface IOneMaxSolutionsVisualizer : ISingleObjectiveSolutionsVisualizer { }
     28  public interface IOneMaxSolutionsVisualizer : IAnalyzer { }
    2929}
  • trunk/sources/HeuristicLab.Problems.OneMax/3.3/OnemaxProblem.cs

    r3528 r3616  
    6464      get { return EvaluatorParameter; }
    6565    }
    66     public OptionalValueParameter<IOneMaxSolutionsVisualizer> VisualizerParameter {
    67       get { return (OptionalValueParameter<IOneMaxSolutionsVisualizer>)Parameters["Visualizer"]; }
    68     }
    69     IParameter IProblem.VisualizerParameter {
    70       get { return VisualizerParameter; }
    71     } 
    7266    public ValueParameter<DoubleValue> BestKnownQualityParameter {
    7367      get { return (ValueParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
     
    10094      get { return EvaluatorParameter.Value; }
    10195    }
    102     public IOneMaxSolutionsVisualizer Visualizer {
    103       get { return VisualizerParameter.Value; }
    104       set { VisualizerParameter.Value = value; }
    105     }
    106     ISolutionsVisualizer IProblem.Visualizer {
    107       get { return VisualizerParameter.Value; }
    108     }
    10996    public DoubleValue BestKnownQuality {
    11097      get { return BestKnownQualityParameter.Value; }
     
    126113      Parameters.Add(new ValueParameter<IOneMaxEvaluator>("Evaluator", "The operator which should be used to evaluate OneMax solutions.", evaluator));
    127114      Parameters.Add(new ValueParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this OneMax instance.", new DoubleValue(5)));
    128       Parameters.Add(new ValueParameter<IOneMaxSolutionsVisualizer>("Visualizer", "The operator which should be used to visualize OneMax solutions.", null));
    129115
    130116      creator.BinaryVectorParameter.ActualName = "OneMaxSolution";
     
    156142        EvaluatorChanged(this, EventArgs.Empty);
    157143    }
    158     public event EventHandler VisualizerChanged;
    159     private void OnVisualizerChanged() {
    160       if (VisualizerChanged != null)
    161         VisualizerChanged(this, EventArgs.Empty);
    162     }
    163144
    164145    public event EventHandler OperatorsChanged;
     
    193174    void BestKnownQualityParameter_ValueChanged(object sender, EventArgs e) {
    194175      BestKnownQualityParameter.Value.Value = Length.Value;
    195     }
    196     void VisualizerParameter_ValueChanged(object sender, EventArgs e) {
    197       OnVisualizerChanged();
    198176    }
    199177    void OneBitflipMoveParameter_ActualNameChanged(object sender, EventArgs e) {
     
    216194      BestKnownQualityParameter.Value.Value = Length.Value;
    217195      BestKnownQualityParameter.ValueChanged += new EventHandler(BestKnownQualityParameter_ValueChanged);
    218       VisualizerParameter.ValueChanged += new EventHandler(VisualizerParameter_ValueChanged);
    219196    }
    220197    private void ParameterizeSolutionCreator() {
  • trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/Interfaces/ISingleObjectiveTestFunctionProblemSolutionsVisualizer.cs

    r3376 r3616  
    2929  /// An interface which represents an operator for visualizing solutions of single objective test functions.
    3030  /// </summary>
    31   public interface ISingleObjectiveTestFunctionProblemSolutionsVisualizer : ISingleObjectiveSolutionsVisualizer {
     31  public interface ISingleObjectiveTestFunctionProblemSolutionsVisualizer : IAnalyzer {
    3232    ILookupParameter<RealVector> PointParameter { get; }
    3333  }
  • trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/SingleObjectiveTestFunctionProblem.cs

    r3450 r3616  
    7575      get { return EvaluatorParameter; }
    7676    }
    77     public OptionalValueParameter<ISingleObjectiveTestFunctionProblemSolutionsVisualizer> VisualizerParameter {
    78       get { return (OptionalValueParameter<ISingleObjectiveTestFunctionProblemSolutionsVisualizer>)Parameters["Visualizer"]; }
    79     }
    80     IParameter IProblem.VisualizerParameter {
    81       get { return VisualizerParameter; }
    82     }
    8377    public OptionalValueParameter<DoubleValue> BestKnownQualityParameter {
    8478      get { return (OptionalValueParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
     
    118112    IEvaluator IProblem.Evaluator {
    119113      get { return EvaluatorParameter.Value; }
    120     }
    121     public ISingleObjectiveTestFunctionProblemSolutionsVisualizer Visualizer {
    122       get { return VisualizerParameter.Value; }
    123       set { VisualizerParameter.Value = value; }
    124     }
    125     ISolutionsVisualizer IProblem.Visualizer {
    126       get { return VisualizerParameter.Value; }
    127114    }
    128115    public DoubleValue BestKnownQuality {
     
    148135      Parameters.Add(new ValueParameter<IRealVectorCreator>("SolutionCreator", "The operator which should be used to create new TSP solutions.", creator));
    149136      Parameters.Add(new ValueParameter<ISingleObjectiveTestFunctionProblemEvaluator>("Evaluator", "The operator which should be used to evaluate TSP solutions.", evaluator));
    150       Parameters.Add(new OptionalValueParameter<ISingleObjectiveTestFunctionProblemSolutionsVisualizer>("Visualizer", "The operator which should be used to visualize TSP solutions."));
    151137      Parameters.Add(new OptionalValueParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this TSP instance.", new DoubleValue(evaluator.BestKnownQuality)));
    152138
     
    182168      if (EvaluatorChanged != null)
    183169        EvaluatorChanged(this, EventArgs.Empty);
    184     }
    185     public event EventHandler VisualizerChanged;
    186     private void OnVisualizerChanged() {
    187       if (VisualizerChanged != null)
    188         VisualizerChanged(this, EventArgs.Empty);
    189170    }
    190171    public event EventHandler OperatorsChanged;
     
    226207    private void Evaluator_QualityParameter_ActualNameChanged(object sender, EventArgs e) {
    227208      ParameterizeOperators();
    228     }
    229     private void VisualizerParameter_ValueChanged(object sender, EventArgs e) {
    230       ParameterizeVisualizer();
    231209    }
    232210    private void BoundsParameter_ValueChanged(object sender, EventArgs e) {
     
    291269      EvaluatorParameter.ValueChanged += new EventHandler(EvaluatorParameter_ValueChanged);
    292270      Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
    293       VisualizerParameter.ValueChanged += new EventHandler(VisualizerParameter_ValueChanged);
    294271      strategyVectorCreator.BoundsParameter.ValueChanged += new EventHandler(strategyVectorCreator_BoundsParameter_ValueChanged);
    295272      strategyVectorCreator.StrategyParameterParameter.ActualNameChanged += new EventHandler(strategyVectorCreator_StrategyParameterParameter_ActualNameChanged);
     
    344321    }
    345322    private void ParameterizeVisualizer() {
    346       if (Visualizer != null) {
    347         Visualizer.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
    348         Visualizer.PointParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
    349       }
     323      //if (Visualizer != null) {
     324      //  Visualizer.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
     325      //  Visualizer.PointParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
     326      //}
    350327    }
    351328    private void ParameterizeOperators() {
  • trunk/sources/HeuristicLab.Problems.TravelingSalesman.Views/3.3/TravelingSalesmanProblemView.cs

    r3566 r3616  
    6666      } else {
    6767        parameterCollectionView.Content = ((IParameterizedNamedItem)Content).Parameters;
    68         pathTSPTourView.Content = new PathTSPTour(Content.Coordinates, Content.BestKnownSolution);
     68        pathTSPTourView.Content = new PathTSPTour(Content.Coordinates, Content.BestKnownSolution, Content.BestKnownQuality);
    6969      }
    7070      SetEnabledStateOfControls();
  • trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/Analyzers/BestTSPSolutionAnalyzer.cs

    r3612 r3616  
    3232namespace HeuristicLab.Problems.TravelingSalesman {
    3333  /// <summary>
    34   /// An operator for visualizing the best tour of Traveling Salesman Problems given in path representation using city coordinates.
     34  /// An operator for analyzing the best solution of Traveling Salesman Problems given in path representation using city coordinates.
    3535  /// </summary>
    36   [Item("BestPathTSPTourVisualizer", "An operator for visualizing the best tour of Traveling Salesman Problems given in path representation using city coordinates.")]
     36  [Item("BestTSPSolutionAnalyzer", "An operator for analyzing the best solution of Traveling Salesman Problems given in path representation using city coordinates.")]
    3737  [StorableClass]
    38   public sealed class BestPathTSPTourVisualizer : SingleSuccessorOperator, IPathCoordinatesTSPSolutionsVisualizer {
    39     public ILookupParameter<DoubleMatrix> CoordinatesParameter {
    40       get { return (ILookupParameter<DoubleMatrix>)Parameters["Coordinates"]; }
     38  public sealed class BestTSPSolutionAnalyzer : SingleSuccessorOperator, IAnalyzer {
     39    public LookupParameter<DoubleMatrix> CoordinatesParameter {
     40      get { return (LookupParameter<DoubleMatrix>)Parameters["Coordinates"]; }
    4141    }
    42     public ILookupParameter<ItemArray<Permutation>> PermutationParameter {
    43       get { return (ILookupParameter<ItemArray<Permutation>>)Parameters["Permutation"]; }
     42    public SubScopesLookupParameter<Permutation> PermutationParameter {
     43      get { return (SubScopesLookupParameter<Permutation>)Parameters["Permutation"]; }
    4444    }
    45     public ILookupParameter<ItemArray<DoubleValue>> QualityParameter {
    46       get { return (ILookupParameter<ItemArray<DoubleValue>>)Parameters["Quality"]; }
     45    public SubScopesLookupParameter<DoubleValue> QualityParameter {
     46      get { return (SubScopesLookupParameter<DoubleValue>)Parameters["Quality"]; }
    4747    }
    48     public ILookupParameter<PathTSPTour> PathTSPTourParameter {
    49       get { return (ILookupParameter<PathTSPTour>)Parameters["PathTSPTour"]; }
     48    public LookupParameter<PathTSPTour> BestSolutionParameter {
     49      get { return (LookupParameter<PathTSPTour>)Parameters["BestSolution"]; }
    5050    }
    51     ILookupParameter ISolutionsVisualizer.VisualizationParameter {
    52       get { return PathTSPTourParameter; }
     51    public ValueLookupParameter<ResultCollection> ResultsParameter {
     52      get { return (ValueLookupParameter<ResultCollection>)Parameters["Results"]; }
    5353    }
    5454
    55     public BestPathTSPTourVisualizer()
     55    public BestTSPSolutionAnalyzer()
    5656      : base() {
    5757      Parameters.Add(new LookupParameter<DoubleMatrix>("Coordinates", "The x- and y-Coordinates of the cities."));
    58       Parameters.Add(new SubScopesLookupParameter<Permutation>("Permutation", "The TSP solutions given in path representation from which the best solution should be visualized."));
    59       Parameters.Add(new SubScopesLookupParameter<DoubleValue>("Quality", "The qualities of the TSP solutions which should be visualized."));
    60       Parameters.Add(new LookupParameter<PathTSPTour>("PathTSPTour", "The visual representation of the best TSP solution."));
     58      Parameters.Add(new SubScopesLookupParameter<Permutation>("Permutation", "The TSP solutions given in path representation from which the best solution should be analyzed."));
     59      Parameters.Add(new SubScopesLookupParameter<DoubleValue>("Quality", "The qualities of the TSP solutions which should be analyzed."));
     60      Parameters.Add(new LookupParameter<PathTSPTour>("BestSolution", "The best TSP solution."));
     61      Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the best TSP solution should be stored."));
    6162    }
    6263
     
    6566      ItemArray<Permutation> permutations = PermutationParameter.ActualValue;
    6667      ItemArray<DoubleValue> qualities = QualityParameter.ActualValue;
     68      ResultCollection results = ResultsParameter.ActualValue;
    6769
    6870      int i = qualities.Select((x, index) => new { index, x.Value }).OrderBy(x => x.Value).First().index;
    6971
    70       PathTSPTour tour = PathTSPTourParameter.ActualValue;
    71       if (tour == null) PathTSPTourParameter.ActualValue = new PathTSPTour(coordinates, permutations[i]);
    72       else {
    73         tour.Coordinates = coordinates;
    74         tour.Permutation = permutations[i];
     72      PathTSPTour tour = BestSolutionParameter.ActualValue;
     73      if (tour == null) {
     74        tour = new PathTSPTour(coordinates, permutations[i], qualities[i]);
     75        BestSolutionParameter.ActualValue = tour;
     76        results.Add(new Result("Best TSP Solution", tour));
     77      } else {
     78        if (tour.Quality.Value > qualities[i].Value) {
     79          tour.Coordinates = coordinates;
     80          tour.Permutation = permutations[i];
     81          tour.Quality = qualities[i];
     82          results["Best TSP Solution"].Value = tour;
     83        }
    7584      }
     85
    7686      return base.Apply();
    7787    }
  • trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/HeuristicLab.Problems.TravelingSalesman-3.3.csproj

    r3384 r3616  
    8484  </ItemGroup>
    8585  <ItemGroup>
     86    <Compile Include="Analyzers\BestTSPSolutionAnalyzer.cs" />
    8687    <Compile Include="Evaluators\TSPEuclideanPathEvaluator.cs" />
    8788    <Compile Include="Evaluators\TSPGeoPathEvaluator.cs" />
     
    9798    <Compile Include="TravelingSalesmanProblem.cs" />
    9899    <Compile Include="TSPLIBTourParser.cs" />
    99     <Compile Include="Interfaces\ICoordinatesTSPSolutionsVisualizer.cs" />
    100     <Compile Include="Interfaces\IPathCoordinatesTSPSolutionsVisualizer.cs" />
    101     <Compile Include="Interfaces\ITSPSolutionsVisualizer.cs" />
    102100    <Compile Include="PathTSPTour.cs" />
    103     <Compile Include="Visualizers\BestPathTSPTourVisualizer.cs" />
    104101    <Compile Include="Evaluators\TSPCoordinatesPathEvaluator.cs" />
    105102    <Compile Include="Evaluators\TSPEvaluator.cs" />
  • trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/PathTSPTour.cs

    r3431 r3616  
    6565      }
    6666    }
     67    [Storable]
     68    private DoubleValue quality;
     69    public DoubleValue Quality {
     70      get { return quality; }
     71      set {
     72        if (quality != value) {
     73          if (quality != null) DeregisterQualityEvents();
     74          quality = value;
     75          if (quality != null) RegisterQualityEvents();
     76          OnQualityChanged();
     77        }
     78      }
     79    }
    6780
    6881    public PathTSPTour() : base() { }
     
    7891      Initialize();
    7992    }
     93    public PathTSPTour(DoubleMatrix coordinates, Permutation permutation, DoubleValue quality)
     94      : base() {
     95      this.coordinates = coordinates;
     96      this.permutation = permutation;
     97      this.quality = quality;
     98      Initialize();
     99    }
    80100    [StorableConstructor]
    81101    private PathTSPTour(bool deserializing) : base(deserializing) { }
     
    85105      if (coordinates != null) RegisterCoordinatesEvents();
    86106      if (permutation != null) RegisterPermutationEvents();
     107      if (quality != null) RegisterQualityEvents();
    87108    }
    88109
     
    92113      clone.coordinates = (DoubleMatrix)cloner.Clone(coordinates);
    93114      clone.permutation = (Permutation)cloner.Clone(permutation);
     115      clone.quality = (DoubleValue)cloner.Clone(quality);
    94116      clone.Initialize();
    95117      return clone;
     
    106128    private void OnPermutationChanged() {
    107129      var changed = PermutationChanged;
     130      if (changed != null)
     131        changed(this, EventArgs.Empty);
     132    }
     133    public event EventHandler QualityChanged;
     134    private void OnQualityChanged() {
     135      var changed = QualityChanged;
    108136      if (changed != null)
    109137        changed(this, EventArgs.Empty);
     
    126154      Permutation.Reset -= new EventHandler(Permutation_Reset);
    127155    }
     156    private void RegisterQualityEvents() {
     157      Quality.ValueChanged += new EventHandler(Quality_ValueChanged);
     158    }
     159    private void DeregisterQualityEvents() {
     160      Quality.ValueChanged -= new EventHandler(Quality_ValueChanged);
     161    }
    128162
    129163    private void Coordinates_ItemChanged(object sender, EventArgs<int, int> e) {
     
    139173      OnPermutationChanged();
    140174    }
     175    private void Quality_ValueChanged(object sender, EventArgs e) {
     176      OnQualityChanged();
     177    }
    141178    #endregion
    142179  }
  • trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/TravelingSalesmanProblem.cs

    r3504 r3616  
    7171      get { return EvaluatorParameter; }
    7272    }
    73     public OptionalValueParameter<ITSPSolutionsVisualizer> VisualizerParameter {
    74       get { return (OptionalValueParameter<ITSPSolutionsVisualizer>)Parameters["Visualizer"]; }
    75     }
    76     IParameter IProblem.VisualizerParameter {
    77       get { return VisualizerParameter; }
    78     }
    7973    public OptionalValueParameter<DoubleValue> BestKnownQualityParameter {
    8074      get { return (OptionalValueParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
     
    118112      get { return EvaluatorParameter.Value; }
    119113    }
    120     public ITSPSolutionsVisualizer Visualizer {
    121       get { return VisualizerParameter.Value; }
    122       set { VisualizerParameter.Value = value; }
    123     }
    124     ISolutionsVisualizer IProblem.Visualizer {
    125       get { return VisualizerParameter.Value; }
    126     }
    127114    public DoubleValue BestKnownQuality {
    128115      get { return BestKnownQualityParameter.Value; }
     
    133120      set { BestKnownSolutionParameter.Value = value; }
    134121    }
    135     private List<IPermutationOperator> operators;
     122    private List<IOperator> operators;
    136123    public IEnumerable<IOperator> Operators {
    137       get { return operators.Cast<IOperator>(); }
     124      get { return operators; }
     125    }
     126    private BestTSPSolutionAnalyzer Analyzer {
     127      get { return operators.OfType<BestTSPSolutionAnalyzer>().FirstOrDefault(); }
    138128    }
    139129    #endregion
     
    143133      RandomPermutationCreator creator = new RandomPermutationCreator();
    144134      TSPRoundedEuclideanPathEvaluator evaluator = new TSPRoundedEuclideanPathEvaluator();
    145       BestPathTSPTourVisualizer visualizer = new BestPathTSPTourVisualizer();
    146135
    147136      Parameters.Add(new ValueParameter<BoolValue>("Maximization", "Set to false as the Traveling Salesman Problem is a minimization problem.", new BoolValue(false)));
     
    151140      Parameters.Add(new ValueParameter<IPermutationCreator>("SolutionCreator", "The operator which should be used to create new TSP solutions.", creator));
    152141      Parameters.Add(new ValueParameter<ITSPEvaluator>("Evaluator", "The operator which should be used to evaluate TSP solutions.", evaluator));
    153       Parameters.Add(new OptionalValueParameter<ITSPSolutionsVisualizer>("Visualizer", "The operator which should be used to visualize TSP solutions.", visualizer));
    154142      Parameters.Add(new OptionalValueParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this TSP instance."));
    155143      Parameters.Add(new OptionalValueParameter<Permutation>("BestKnownSolution", "The best known solution of this TSP instance."));
     
    166154      ParameterizeSolutionCreator();
    167155      ParameterizeEvaluator();
    168       ParameterizeVisualizer();
    169156
    170157      Initialize();
     
    221208        EvaluatorChanged(this, EventArgs.Empty);
    222209    }
    223     public event EventHandler VisualizerChanged;
    224     private void OnVisualizerChanged() {
    225       if (VisualizerChanged != null)
    226         VisualizerChanged(this, EventArgs.Empty);
    227     }
    228210    public event EventHandler OperatorsChanged;
    229211    private void OnOperatorsChanged() {
     
    249231      ParameterizeSolutionCreator();
    250232      ParameterizeEvaluator();
    251       ParameterizeVisualizer();
     233      ParameterizeAnalyzer();
    252234      ParameterizeOperators();
    253235      OnSolutionCreatorChanged();
     
    255237    private void SolutionCreator_PermutationParameter_ActualNameChanged(object sender, EventArgs e) {
    256238      ParameterizeEvaluator();
    257       ParameterizeVisualizer();
     239      ParameterizeAnalyzer();
    258240      ParameterizeOperators();
    259241    }
     
    262244      ParameterizeEvaluator();
    263245      UpdateMoveEvaluators();
    264       ParameterizeVisualizer();
     246      ParameterizeAnalyzer();
    265247      ClearDistanceMatrix();
    266248      OnEvaluatorChanged();
    267249    }
    268250    private void Evaluator_QualityParameter_ActualNameChanged(object sender, EventArgs e) {
    269       ParameterizeVisualizer();
    270     }
    271     private void VisualizerParameter_ValueChanged(object sender, EventArgs e) {
    272       ParameterizeVisualizer();
    273       OnVisualizerChanged();
     251      ParameterizeAnalyzer();
    274252    }
    275253    private void MoveGenerator_InversionMoveParameter_ActualNameChanged(object sender, EventArgs e) {
     
    298276      EvaluatorParameter.ValueChanged += new EventHandler(EvaluatorParameter_ValueChanged);
    299277      Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
    300       VisualizerParameter.ValueChanged += new EventHandler(VisualizerParameter_ValueChanged);
    301278    }
    302279
    303280    private void InitializeOperators() {
    304       operators = new List<IPermutationOperator>();
    305       operators.AddRange(ApplicationManager.Manager.GetInstances<IPermutationOperator>());
     281      operators = new List<IOperator>();
     282      operators.Add(new BestTSPSolutionAnalyzer());
     283      ParameterizeAnalyzer();
     284      operators.AddRange(ApplicationManager.Manager.GetInstances<IPermutationOperator>().Cast<IOperator>());
    306285      ParameterizeOperators();
    307286      UpdateMoveEvaluators();
     
    344323      }
    345324    }
    346     private void ParameterizeVisualizer() {
    347       if (Visualizer != null) {
    348         Visualizer.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
    349         if (Visualizer is ICoordinatesTSPSolutionsVisualizer)
    350           ((ICoordinatesTSPSolutionsVisualizer)Visualizer).CoordinatesParameter.ActualName = CoordinatesParameter.Name;
    351         if (Visualizer is IPathCoordinatesTSPSolutionsVisualizer)
    352           ((IPathCoordinatesTSPSolutionsVisualizer)Visualizer).PermutationParameter.ActualName = SolutionCreator.PermutationParameter.ActualName;
     325    private void ParameterizeAnalyzer() {
     326      if (Analyzer != null) {
     327        Analyzer.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
     328        Analyzer.CoordinatesParameter.ActualName = CoordinatesParameter.Name;
     329        Analyzer.PermutationParameter.ActualName = SolutionCreator.PermutationParameter.ActualName;
     330        Analyzer.ResultsParameter.ActualName = "Results";
    353331      }
    354332    }
Note: See TracChangeset for help on using the changeset viewer.