Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3108


Ignore:
Timestamp:
03/19/10 10:45:25 (15 years ago)
Author:
svonolfe
Message:

Implemented review comments (#916)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.OneMax/3.3/Onemax.cs

    r3107 r3108  
    6666    IParameter IProblem.VisualizerParameter {
    6767      get { throw new NotImplementedException(); }
    68     }
     68    } 
    6969    public ValueParameter<DoubleValue> BestKnownQualityParameter {
    7070      get { return (ValueParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
     
    7676
    7777    #region Properties
     78    public IntValue Length {
     79      get { return LengthParameter.Value; }
     80      set { LengthParameter.Value = value; }
     81    }
    7882    public IBinaryVectorCreator SolutionCreator {
    7983      get { return SolutionCreatorParameter.Value; }
     
    9599    ISolutionsVisualizer IProblem.Visualizer {
    96100      get { throw new NotImplementedException(); }
    97     }
     101    } 
    98102    public DoubleValue BestKnownQuality {
    99103      get { return BestKnownQualityParameter.Value; }
     
    145149    }
    146150    public event EventHandler VisualizerChanged;
     151    private void OnVisualizerChanged() {
     152      if (VisualizerChanged != null)
     153        VisualizerChanged(this, EventArgs.Empty);
     154    }
     155
    147156    public event EventHandler OperatorsChanged;
    148157    private void OnOperatorsChanged() {
     
    165174      ParameterizeEvaluator();
    166175      OnEvaluatorChanged();
     176    }
     177    void LengthParameter_ValueChanged(object sender, EventArgs e) {
     178      ParameterizeSolutionCreator();
     179      LengthParameter.Value.ValueChanged += new EventHandler(Length_ValueChanged);
     180    }
     181    void Length_ValueChanged(object sender, EventArgs e) {
     182      BestKnownQualityParameter.Value.Value = Length.Value;
     183    }
     184    void BestKnownQualityParameter_ValueChanged(object sender, EventArgs e) {
     185      BestKnownQualityParameter.Value.Value = Length.Value;
    167186    }
    168187    #endregion
     
    175194      SolutionCreator.BinaryVectorParameter.ActualNameChanged += new EventHandler(SolutionCreator_PermutationParameter_ActualNameChanged);
    176195      EvaluatorParameter.ValueChanged += new EventHandler(EvaluatorParameter_ValueChanged);
     196      LengthParameter.ValueChanged += new EventHandler(LengthParameter_ValueChanged);
     197      BestKnownQualityParameter.Value.Value = Length.Value;
     198      BestKnownQualityParameter.ValueChanged += new EventHandler(BestKnownQualityParameter_ValueChanged);
    177199    }
    178200    private void ParameterizeSolutionCreator() {
    179       SolutionCreator.LengthParameter.Value = LengthParameter.Value;
     201      SolutionCreator.LengthParameter.ActualName = LengthParameter.Name;
    180202    }
    181203    private void ParameterizeEvaluator() {
Note: See TracChangeset for help on using the changeset viewer.