Changeset 3661


Ignore:
Timestamp:
05/06/10 02:00:55 (12 years ago)
Author:
abeham
Message:

#999

  • prepared TF visualization
  • removed obsolete TF solution analyzers
Location:
trunk/sources
Files:
1 deleted
5 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.TestFunctions.Views/3.3/SingleObjectiveTestFunctionSolutionView.Designer.cs

    r3647 r3661  
    2929      this.groupBox4 = new System.Windows.Forms.GroupBox();
    3030      this.realVectorView = new HeuristicLab.MainForm.WindowsForms.ViewHost();
     31      this.tabControl1 = new System.Windows.Forms.TabControl();
     32      this.textualTabPage = new System.Windows.Forms.TabPage();
     33      this.graphicalTabPage = new System.Windows.Forms.TabPage();
     34      this.label1 = new System.Windows.Forms.Label();
     35      this.pictureBox = new System.Windows.Forms.PictureBox();
    3136      this.splitContainer1.Panel1.SuspendLayout();
    3237      this.splitContainer1.Panel2.SuspendLayout();
     
    3439      this.groupBox3.SuspendLayout();
    3540      this.groupBox4.SuspendLayout();
     41      this.tabControl1.SuspendLayout();
     42      this.textualTabPage.SuspendLayout();
     43      this.graphicalTabPage.SuspendLayout();
     44      ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit();
    3645      this.SuspendLayout();
    3746      //
     
    4453      this.qualityView.Name = "qualityView";
    4554      this.qualityView.ReadOnly = false;
    46       this.qualityView.Size = new System.Drawing.Size(386, 31);
     55      this.qualityView.Size = new System.Drawing.Size(485, 31);
    4756      this.qualityView.TabIndex = 1;
    4857      this.qualityView.ViewType = null;
     
    6675      this.splitContainer1.Panel2.Controls.Add(this.groupBox4);
    6776      this.splitContainer1.Panel2MinSize = 30;
    68       this.splitContainer1.Size = new System.Drawing.Size(392, 265);
     77      this.splitContainer1.Size = new System.Drawing.Size(491, 304);
    6978      this.splitContainer1.TabIndex = 7;
    7079      //
     
    7584      this.groupBox3.Location = new System.Drawing.Point(0, 0);
    7685      this.groupBox3.Name = "groupBox3";
    77       this.groupBox3.Size = new System.Drawing.Size(392, 50);
     86      this.groupBox3.Size = new System.Drawing.Size(491, 50);
    7887      this.groupBox3.TabIndex = 6;
    7988      this.groupBox3.TabStop = false;
     
    8695      this.groupBox4.Location = new System.Drawing.Point(0, 0);
    8796      this.groupBox4.Name = "groupBox4";
    88       this.groupBox4.Size = new System.Drawing.Size(392, 211);
     97      this.groupBox4.Size = new System.Drawing.Size(491, 250);
    8998      this.groupBox4.TabIndex = 6;
    9099      this.groupBox4.TabStop = false;
     
    99108      this.realVectorView.Name = "realVectorView";
    100109      this.realVectorView.ReadOnly = false;
    101       this.realVectorView.Size = new System.Drawing.Size(386, 192);
     110      this.realVectorView.Size = new System.Drawing.Size(485, 231);
    102111      this.realVectorView.TabIndex = 1;
    103112      this.realVectorView.ViewType = null;
    104113      //
     114      // tabControl1
     115      //
     116      this.tabControl1.Controls.Add(this.textualTabPage);
     117      this.tabControl1.Controls.Add(this.graphicalTabPage);
     118      this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
     119      this.tabControl1.Location = new System.Drawing.Point(0, 0);
     120      this.tabControl1.Name = "tabControl1";
     121      this.tabControl1.SelectedIndex = 0;
     122      this.tabControl1.Size = new System.Drawing.Size(505, 336);
     123      this.tabControl1.TabIndex = 2;
     124      //
     125      // textualTabPage
     126      //
     127      this.textualTabPage.Controls.Add(this.splitContainer1);
     128      this.textualTabPage.Location = new System.Drawing.Point(4, 22);
     129      this.textualTabPage.Name = "textualTabPage";
     130      this.textualTabPage.Padding = new System.Windows.Forms.Padding(3);
     131      this.textualTabPage.Size = new System.Drawing.Size(497, 310);
     132      this.textualTabPage.TabIndex = 0;
     133      this.textualTabPage.Text = "Textual";
     134      this.textualTabPage.UseVisualStyleBackColor = true;
     135      //
     136      // graphicalTabPage
     137      //
     138      this.graphicalTabPage.Controls.Add(this.pictureBox);
     139      this.graphicalTabPage.Controls.Add(this.label1);
     140      this.graphicalTabPage.Location = new System.Drawing.Point(4, 22);
     141      this.graphicalTabPage.Name = "graphicalTabPage";
     142      this.graphicalTabPage.Padding = new System.Windows.Forms.Padding(3);
     143      this.graphicalTabPage.Size = new System.Drawing.Size(497, 310);
     144      this.graphicalTabPage.TabIndex = 1;
     145      this.graphicalTabPage.Text = "Graphical";
     146      this.graphicalTabPage.UseVisualStyleBackColor = true;
     147      //
     148      // label1
     149      //
     150      this.label1.Anchor = System.Windows.Forms.AnchorStyles.None;
     151      this.label1.AutoSize = true;
     152      this.label1.Location = new System.Drawing.Point(118, 131);
     153      this.label1.Name = "label1";
     154      this.label1.Size = new System.Drawing.Size(253, 13);
     155      this.label1.TabIndex = 0;
     156      this.label1.Text = "The graphical view is only available for 2 dimensions";
     157      //
     158      // pictureBox
     159      //
     160      this.pictureBox.BackColor = System.Drawing.Color.White;
     161      this.pictureBox.Dock = System.Windows.Forms.DockStyle.Fill;
     162      this.pictureBox.Location = new System.Drawing.Point(0, 0);
     163      this.pictureBox.Name = "pictureBox";
     164      this.pictureBox.Size = new System.Drawing.Size(491, 304);
     165      this.pictureBox.TabIndex = 1;
     166      this.pictureBox.TabStop = false;
     167      //
    105168      // SingleObjectiveTestFunctionSolutionView
    106169      //
    107170      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    108       this.Controls.Add(this.splitContainer1);
     171      this.Controls.Add(this.tabControl1);
    109172      this.Name = "SingleObjectiveTestFunctionSolutionView";
    110       this.Size = new System.Drawing.Size(392, 265);
     173      this.Size = new System.Drawing.Size(505, 336);
    111174      this.splitContainer1.Panel1.ResumeLayout(false);
    112175      this.splitContainer1.Panel2.ResumeLayout(false);
     
    114177      this.groupBox3.ResumeLayout(false);
    115178      this.groupBox4.ResumeLayout(false);
     179      this.tabControl1.ResumeLayout(false);
     180      this.textualTabPage.ResumeLayout(false);
     181      this.graphicalTabPage.ResumeLayout(false);
     182      this.graphicalTabPage.PerformLayout();
     183      ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit();
    116184      this.ResumeLayout(false);
    117185
     
    125193    private System.Windows.Forms.GroupBox groupBox3;
    126194    protected HeuristicLab.MainForm.WindowsForms.ViewHost realVectorView;
     195    private System.Windows.Forms.TabControl tabControl1;
     196    private System.Windows.Forms.TabPage textualTabPage;
     197    private System.Windows.Forms.TabPage graphicalTabPage;
     198    private System.Windows.Forms.Label label1;
     199    private System.Windows.Forms.PictureBox pictureBox;
    127200
    128201
  • trunk/sources/HeuristicLab.Problems.TestFunctions.Views/3.3/SingleObjectiveTestFunctionSolutionView.cs

    r3649 r3661  
    3131namespace HeuristicLab.Problems.TestFunctions.Views {
    3232  /// <summary>
    33   /// A view for a OneMax solution.
     33  /// A view for a SingleObjectiveTestFunctions solution.
    3434  /// </summary>
    35   [View("OneMax View")]
     35  [View("Single Objective Test Functions View")]
    3636  [Content(typeof(SingleObjectiveTestFunctionSolution), true)]
    3737  public partial class SingleObjectiveTestFunctionSolutionView : HeuristicLab.Core.Views.ItemView {
     
    6464      else {
    6565        qualityView.ViewType = null;
    66         qualityView.Content = Content.Quality;
     66        qualityView.Content = Content.BestQuality;
    6767      }
    6868    }
     
    7373      else {
    7474        realVectorView.ViewType = null;
    75         realVectorView.Content = Content.RealVector;
     75        realVectorView.Content = Content.BestRealVector;
     76        pictureBox.Visible = Content.BestRealVector.Length == 2;
    7677      }
    7778    }
     
    8586      } else {
    8687        qualityView.ViewType = null;
    87         qualityView.Content = Content.Quality;
     88        qualityView.Content = Content.BestQuality;
    8889
    8990        realVectorView.ViewType = null;
    90         realVectorView.Content = Content.RealVector;
     91        realVectorView.Content = Content.BestRealVector;
     92
     93        pictureBox.Visible = Content.BestRealVector.Length == 2;
    9194      }
    9295
  • trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/Analyzers/BestSingleObjectiveTestFunctionSolutionAnalyzer.cs

    r3660 r3661  
    3636  /// An operator for analyzing the best solution for a SingleObjectiveTestFunction problem.
    3737  /// </summary>
    38   [Item("PopulationBestSingleObjectiveTestFunctionSolutionAnalyzer", "An operator for analyzing the best solution for a SingleObjectiveTestFunction problem.")]
     38  [Item("BestSingleObjectiveTestFunctionSolutionAnalyzer", "An operator for analyzing the best solution for a SingleObjectiveTestFunction problem.")]
    3939  [StorableClass]
    40   class PopulationBestSingleObjectiveTestFunctionSolutionAnalyzer : SingleSuccessorOperator, IBestSingleObjectiveTestFunctionSolutionAnalyzer, IAnalyzer {
     40  class BestSingleObjectiveTestFunctionSolutionAnalyzer : SingleSuccessorOperator, IBestSingleObjectiveTestFunctionSolutionAnalyzer, IAnalyzer {
    4141
    42     public ILookupParameter<ItemArray<RealVector>> RealVectorParameter {
    43       get { return (ILookupParameter<ItemArray<RealVector>>)Parameters["RealVector"]; }
     42    public ScopeTreeLookupParameter<RealVector> RealVectorParameter {
     43      get { return (ScopeTreeLookupParameter<RealVector>)Parameters["RealVector"]; }
    4444    }
    4545    ILookupParameter IBestSingleObjectiveTestFunctionSolutionAnalyzer.RealVectorParameter {
    4646      get { return RealVectorParameter; }
    4747    }
    48     public ILookupParameter<ItemArray<DoubleValue>> QualityParameter {
    49       get { return (ILookupParameter<ItemArray<DoubleValue>>)Parameters["Quality"]; }
     48    public ScopeTreeLookupParameter<DoubleValue> QualityParameter {
     49      get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; }
    5050    }
    5151    ILookupParameter IBestSingleObjectiveTestFunctionSolutionAnalyzer.QualityParameter {
     
    5858      get { return (IValueLookupParameter<ResultCollection>)Parameters["Results"]; }
    5959    }
     60    public IValueLookupParameter<ISingleObjectiveTestFunctionProblemEvaluator> EvaluatorParameter {
     61      get { return (IValueLookupParameter<ISingleObjectiveTestFunctionProblemEvaluator>)Parameters["Evaluator"]; }
     62    }
    6063
    61     public PopulationBestSingleObjectiveTestFunctionSolutionAnalyzer()
     64    public BestSingleObjectiveTestFunctionSolutionAnalyzer()
    6265      : base() {
    6366      Parameters.Add(new ScopeTreeLookupParameter<RealVector>("RealVector", "The SingleObjectiveTestFunction solutions from which the best solution should be visualized."));
    64 
    6567      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The qualities of the SingleObjectiveTestFunction solutions which should be visualized."));
    6668      Parameters.Add(new LookupParameter<SingleObjectiveTestFunctionSolution>("BestSolution", "The best SingleObjectiveTestFunction solution."));
    6769      Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the SingleObjectiveTestFunction solution should be stored."));
     70      Parameters.Add(new ValueLookupParameter<ISingleObjectiveTestFunctionProblemEvaluator>("Evaluator", "The evaluator with which the solution is evaluated."));
    6871    }
    6972
    7073    public override IOperation Apply() {
    71       ItemArray<RealVector> RealVectors = RealVectorParameter.ActualValue;
     74      ItemArray<RealVector> realVectors = RealVectorParameter.ActualValue;
    7275      ItemArray<DoubleValue> qualities = QualityParameter.ActualValue;
    7376      ResultCollection results = ResultsParameter.ActualValue;
     77      ISingleObjectiveTestFunctionProblemEvaluator evaluator = EvaluatorParameter.ActualValue;
    7478
    7579      int i = qualities.Select((x, index) => new { index, x.Value }).OrderBy(x => x.Value).First().index;
    7680      SingleObjectiveTestFunctionSolution solution = BestSolutionParameter.ActualValue;
    7781      if (solution == null) {
    78         solution = new SingleObjectiveTestFunctionSolution(RealVectors[i], QualityParameter.ActualValue[i]);
     82        solution = new SingleObjectiveTestFunctionSolution(realVectors[i], qualities[i], evaluator);
     83        solution.Population = realVectors;
    7984        BestSolutionParameter.ActualValue = solution;
    8085
    8186        results.Add(new Result("Best SingleObjectiveTestFunction Solution", solution));
    8287      } else {
    83         solution.RealVector = RealVectors[i];
    84         solution.Quality = QualityParameter.ActualValue[i];
     88        if (evaluator.Maximization && qualities[i].Value > solution.BestQuality.Value
     89          || !evaluator.Maximization && qualities[i].Value < solution.BestQuality.Value) {
     90          solution.BestRealVector = realVectors[i];
     91          solution.BestQuality = qualities[i];
     92        }
     93        solution.Population = realVectors;
    8594
    86         results["Best SingleObjectiveTestFunction Solution"].Value = solution;
     95        //results["Best SingleObjectiveTestFunction Solution"].Value = solution;
    8796      }
    8897
  • trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/HeuristicLab.Problems.TestFunctions-3.3.csproj

    r3647 r3661  
    8484  </ItemGroup>
    8585  <ItemGroup>
    86     <Compile Include="Analyzers\BestSingleObjectiveTestFunctionSolutionAnalyzer.cs" />
    87     <Compile Include="Analyzers\MultiPopulationBestSingleObjectiveTestFunctionSolutionAnalyzer.cs" />
    88     <Compile Include="Analyzers\PopulationBestSingleObjectiveTestFunctionSolutionAnalyzer.cs" />
     86    <Compile Include="Analyzers\BestSingleObjectiveTestFunctionSolutionAnalyzer.cs">
     87      <SubType>Code</SubType>
     88    </Compile>
    8989    <Compile Include="Evaluators\AckleyEvaluator.cs" />
    9090    <Compile Include="Evaluators\BealeEvaluator.cs" />
  • trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/SingleObjectiveTestFunctionProblem.cs

    r3647 r3661  
    286286      operators = new List<IOperator>();
    287287      operators.Add(new BestSingleObjectiveTestFunctionSolutionAnalyzer());
    288       operators.Add(new PopulationBestSingleObjectiveTestFunctionSolutionAnalyzer());
    289       operators.Add(new MultiPopulationBestSingleObjectiveTestFunctionSolutionAnalyzer());
    290288      ParameterizeAnalyzers();
    291289      operators.AddRange(ApplicationManager.Manager.GetInstances<IRealVectorOperator>().Cast<IOperator>());
  • trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/SingleObjectiveTestFunctionSolution.cs

    r3647 r3661  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
     23using System.Drawing;
     24using HeuristicLab.Collections;
     25using HeuristicLab.Common;
    2626using HeuristicLab.Core;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    28 using System.Drawing;
    2927using HeuristicLab.Data;
    3028using HeuristicLab.Encodings.RealVectorEncoding;
    31 using HeuristicLab.Common;
     29using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3230
    3331namespace HeuristicLab.Problems.TestFunctions {
     
    4341
    4442    [Storable]
    45     private RealVector realVector;
    46     public RealVector RealVector {
    47       get { return realVector; }
    48       set {
    49         if (realVector != value) {
    50           if (realVector != null) DeregisterRealVectorEvents();
    51           realVector = value;
    52           if (realVector != null) RegisterRealVectorEvents();
     43    private RealVector bestKnownRealVector;
     44    public RealVector BestKnownRealVector {
     45      get { return bestKnownRealVector; }
     46      set {
     47        if (bestKnownRealVector != value) {
     48          if (bestKnownRealVector != null) DeregisterBestKnownRealVectorEvents();
     49          bestKnownRealVector = value;
     50          if (bestKnownRealVector != null) RegisterBestKnownRealVectorEvents();
     51          OnBestKnownRealVectorChanged();
     52        }
     53      }
     54    }
     55
     56    [Storable]
     57    private RealVector bestRealVector;
     58    public RealVector BestRealVector {
     59      get { return bestRealVector; }
     60      set {
     61        if (bestRealVector != value) {
     62          if (bestRealVector != null) DeregisterRealVectorEvents();
     63          bestRealVector = value;
     64          if (bestRealVector != null) RegisterRealVectorEvents();
    5365          OnRealVectorChanged();
    5466        }
     
    5769
    5870    [Storable]
    59     private DoubleValue quality;
    60     public DoubleValue Quality {
    61       get { return quality; }
    62       set {
    63         if (quality != value) {
    64           if (quality != null) DeregisterQualityEvents();
    65           quality = value;
    66           if (quality != null) RegisterQualityEvents();
     71    private DoubleValue bestQuality;
     72    public DoubleValue BestQuality {
     73      get { return bestQuality; }
     74      set {
     75        if (bestQuality != value) {
     76          if (bestQuality != null) DeregisterQualityEvents();
     77          bestQuality = value;
     78          if (bestQuality != null) RegisterQualityEvents();
    6779          OnQualityChanged();
    6880        }
     
    7082    }
    7183
     84    [Storable]
     85    private ItemArray<RealVector> population;
     86    public ItemArray<RealVector> Population {
     87      get { return population; }
     88      set {
     89        if (population != value) {
     90          if (population != null) DeregisterPopulationEvents();
     91          population = value;
     92          if (population != null) RegisterPopulationEvents();
     93          OnPopulationChanged();
     94        }
     95      }
     96    }
     97
     98    [Storable]
     99    private ISingleObjectiveTestFunctionProblemEvaluator evaluator;
     100    public ISingleObjectiveTestFunctionProblemEvaluator Evaluator {
     101      get { return evaluator; }
     102      set {
     103        if (evaluator != value) {
     104          evaluator = value;
     105          OnEvaluatorChanged();
     106        }
     107      }
     108    }
     109
     110    private Image fitnessLandscape;
     111    public Image FitnessLandscape {
     112      get { return fitnessLandscape; }
     113      set { fitnessLandscape = value; }
     114    }
     115
    72116    public SingleObjectiveTestFunctionSolution() : base() { }
    73     public SingleObjectiveTestFunctionSolution(RealVector realVector, DoubleValue quality)
     117    public SingleObjectiveTestFunctionSolution(RealVector realVector, DoubleValue quality, ISingleObjectiveTestFunctionProblemEvaluator evaluator)
    74118      : base() {
    75       this.realVector = realVector;
    76       this.quality = quality;
     119      this.bestRealVector = realVector;
     120      this.bestQuality = quality;
     121      this.evaluator = evaluator;
    77122      Initialize();
    78123    }
     
    82127    [StorableHook(HookType.AfterDeserialization)]
    83128    private void Initialize() {
    84       if (realVector != null) RegisterRealVectorEvents();
    85       if (quality != null) RegisterQualityEvents();
     129      if (bestKnownRealVector != null) RegisterBestKnownRealVectorEvents();
     130      if (bestRealVector != null) RegisterRealVectorEvents();
     131      if (bestQuality != null) RegisterQualityEvents();
     132      if (population != null) RegisterPopulationEvents();
    86133    }
    87134
     
    89136      SingleObjectiveTestFunctionSolution clone = new SingleObjectiveTestFunctionSolution();
    90137      cloner.RegisterClonedObject(this, clone);
    91       clone.realVector = (RealVector)cloner.Clone(realVector);
    92       clone.quality = (DoubleValue)cloner.Clone(quality);
     138      clone.bestKnownRealVector = (RealVector)cloner.Clone(bestKnownRealVector);
     139      clone.bestRealVector = (RealVector)cloner.Clone(bestRealVector);
     140      clone.bestQuality = (DoubleValue)cloner.Clone(bestQuality);
     141      clone.population = (ItemArray<RealVector>)cloner.Clone(population);
     142      clone.evaluator = (ISingleObjectiveTestFunctionProblemEvaluator)cloner.Clone(evaluator);
     143      clone.fitnessLandscape = null;
    93144      clone.Initialize();
    94145      return clone;
     
    96147
    97148    #region Events
     149    public event EventHandler BestKnownRealVectorChanged;
     150    private void OnBestKnownRealVectorChanged() {
     151      var changed = BestKnownRealVectorChanged;
     152      if (changed != null)
     153        changed(this, EventArgs.Empty);
     154    }
     155
    98156    public event EventHandler RealVectorChanged;
    99157    private void OnRealVectorChanged() {
     
    110168    }
    111169
     170    public event EventHandler PopulationChanged;
     171    private void OnPopulationChanged() {
     172      var changed = PopulationChanged;
     173      if (changed != null)
     174        changed(this, EventArgs.Empty);
     175    }
     176
     177    public event EventHandler EvaluatorChanged;
     178    private void OnEvaluatorChanged() {
     179      var changed = EvaluatorChanged;
     180      if (changed != null)
     181        changed(this, EventArgs.Empty);
     182    }
     183
     184    private void RegisterBestKnownRealVectorEvents() {
     185      BestKnownRealVector.ItemChanged += new EventHandler<EventArgs<int>>(BestKnownRealVector_ItemChanged);
     186      BestKnownRealVector.Reset += new EventHandler(BestKnownRealVector_Reset);
     187    }
     188    private void DeregisterBestKnownRealVectorEvents() {
     189      BestKnownRealVector.ItemChanged -= new EventHandler<EventArgs<int>>(BestKnownRealVector_ItemChanged);
     190      BestKnownRealVector.Reset -= new EventHandler(BestKnownRealVector_Reset);
     191    }
    112192    private void RegisterRealVectorEvents() {
    113       RealVector.ItemChanged += new EventHandler<EventArgs<int>>(RealVector_ItemChanged);
    114       RealVector.Reset += new EventHandler(RealVector_Reset);
    115     }
    116 
     193      BestRealVector.ItemChanged += new EventHandler<EventArgs<int>>(RealVector_ItemChanged);
     194      BestRealVector.Reset += new EventHandler(RealVector_Reset);
     195    }
    117196    private void DeregisterRealVectorEvents() {
    118       RealVector.ItemChanged -= new EventHandler<EventArgs<int>>(RealVector_ItemChanged);
    119       RealVector.Reset -= new EventHandler(RealVector_Reset);
     197      BestRealVector.ItemChanged -= new EventHandler<EventArgs<int>>(RealVector_ItemChanged);
     198      BestRealVector.Reset -= new EventHandler(RealVector_Reset);
    120199    }
    121200    private void RegisterQualityEvents() {
    122       Quality.ValueChanged += new EventHandler(Quality_ValueChanged);
     201      BestQuality.ValueChanged += new EventHandler(Quality_ValueChanged);
    123202    }
    124203    private void DeregisterQualityEvents() {
    125       Quality.ValueChanged -= new EventHandler(Quality_ValueChanged);
    126     }
    127 
     204      BestQuality.ValueChanged -= new EventHandler(Quality_ValueChanged);
     205    }
     206    private void RegisterPopulationEvents() {
     207      Population.CollectionReset += new CollectionItemsChangedEventHandler<IndexedItem<RealVector>>(Population_CollectionReset);
     208      Population.ItemsMoved += new CollectionItemsChangedEventHandler<IndexedItem<RealVector>>(Population_ItemsMoved);
     209      Population.ItemsReplaced += new CollectionItemsChangedEventHandler<IndexedItem<RealVector>>(Population_ItemsReplaced);
     210    }
     211    private void DeregisterPopulationEvents() {
     212      Population.CollectionReset -= new CollectionItemsChangedEventHandler<IndexedItem<RealVector>>(Population_CollectionReset);
     213      Population.ItemsMoved -= new CollectionItemsChangedEventHandler<IndexedItem<RealVector>>(Population_ItemsMoved);
     214      Population.ItemsReplaced -= new CollectionItemsChangedEventHandler<IndexedItem<RealVector>>(Population_ItemsReplaced);
     215    }
     216
     217    private void BestKnownRealVector_ItemChanged(object sender, EventArgs<int> e) {
     218      OnBestKnownRealVectorChanged();
     219    }
     220    private void BestKnownRealVector_Reset(object sender, EventArgs e) {
     221      OnBestKnownRealVectorChanged();
     222    }
    128223    private void RealVector_ItemChanged(object sender, EventArgs<int> e) {
    129224      OnRealVectorChanged();
     
    134229    private void Quality_ValueChanged(object sender, EventArgs e) {
    135230      OnQualityChanged();
     231    }
     232    private void Population_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedItem<RealVector>> e) {
     233      OnPopulationChanged();
     234    }
     235    private void Population_ItemsMoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<RealVector>> e) {
     236      OnPopulationChanged();
     237    }
     238    private void Population_CollectionReset(object sender, CollectionItemsChangedEventArgs<IndexedItem<RealVector>> e) {
     239      OnPopulationChanged();
    136240    }
    137241    #endregion
Note: See TracChangeset for help on using the changeset viewer.