Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3115


Ignore:
Timestamp:
03/19/10 14:17:22 (15 years ago)
Author:
svonolfe
Message:

Further implemented review comments (#916)

Location:
trunk/sources/HeuristicLab.Problems.OneMax/3.3
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.OneMax/3.3/HeuristicLab.Problems.OneMax-3.3.csproj

    r3082 r3115  
    8686  </ItemGroup>
    8787  <ItemGroup>
     88    <Compile Include="Interfaces\IOneMaxSolutionsVisualizer.cs" />
    8889    <Compile Include="Properties\AssemblyInfo.cs" />
    8990    <Compile Include="Evaluators\OneMaxEvaluator.cs" />
  • trunk/sources/HeuristicLab.Problems.OneMax/3.3/Onemax.cs

    r3108 r3115  
    6464      get { return EvaluatorParameter; }
    6565    }
     66    public OptionalValueParameter<IOneMaxSolutionsVisualizer> VisualizerParameter {
     67      get { return (OptionalValueParameter<IOneMaxSolutionsVisualizer>)Parameters["Visualizer"]; }
     68    }
    6669    IParameter IProblem.VisualizerParameter {
    67       get { throw new NotImplementedException(); }
     70      get { return VisualizerParameter; }
    6871    } 
    6972    public ValueParameter<DoubleValue> BestKnownQualityParameter {
     
    97100      get { return EvaluatorParameter.Value; }
    98101    }
     102    public IOneMaxSolutionsVisualizer Visualizer {
     103      get { return VisualizerParameter.Value; }
     104      set { VisualizerParameter.Value = value; }
     105    }
    99106    ISolutionsVisualizer IProblem.Visualizer {
    100       get { throw new NotImplementedException(); }
     107      get { return VisualizerParameter.Value; }
    101108    }
    102109    public DoubleValue BestKnownQuality {
     
    119126      Parameters.Add(new ValueParameter<IOneMaxEvaluator>("Evaluator", "The operator which should be used to evaluate OneMax solutions.", evaluator));
    120127      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));
    121129
    122130      creator.BinaryVectorParameter.ActualName = "OneMaxSolution";
     
    178186      ParameterizeSolutionCreator();
    179187      LengthParameter.Value.ValueChanged += new EventHandler(Length_ValueChanged);
     188      BestKnownQualityParameter.Value.Value = Length.Value;
    180189    }
    181190    void Length_ValueChanged(object sender, EventArgs e) {
     
    184193    void BestKnownQualityParameter_ValueChanged(object sender, EventArgs e) {
    185194      BestKnownQualityParameter.Value.Value = Length.Value;
     195    }
     196    void VisualizerParameter_ValueChanged(object sender, EventArgs e) {
     197      OnVisualizerChanged();
    186198    }
    187199    #endregion
     
    195207      EvaluatorParameter.ValueChanged += new EventHandler(EvaluatorParameter_ValueChanged);
    196208      LengthParameter.ValueChanged += new EventHandler(LengthParameter_ValueChanged);
     209      LengthParameter.Value.ValueChanged += new EventHandler(Length_ValueChanged);
    197210      BestKnownQualityParameter.Value.Value = Length.Value;
    198211      BestKnownQualityParameter.ValueChanged += new EventHandler(BestKnownQualityParameter_ValueChanged);
     212      VisualizerParameter.ValueChanged += new EventHandler(VisualizerParameter_ValueChanged);
    199213    }
    200214    private void ParameterizeSolutionCreator() {
Note: See TracChangeset for help on using the changeset viewer.