Free cookie consent management tool by TermsFeed Policy Generator

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

Further implemented review comments (#917)

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

Legend:

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

    r3082 r3116  
    8484    <Compile Include="HeuristicLabProblemsKnapsackPlugin.cs" />
    8585    <Compile Include="Interfaces\IKnapsackEvaluator.cs" />
     86    <Compile Include="Interfaces\IKnapsackSolutionsVisualizer.cs" />
    8687    <Compile Include="Knapsack.cs" />
    8788    <Compile Include="Properties\AssemblyInfo.cs" />
  • trunk/sources/HeuristicLab.Problems.Knapsack/3.3/Knapsack.cs

    r3111 r3116  
    7373      get { return EvaluatorParameter; }
    7474    }
     75    public OptionalValueParameter<IKnapsackSolutionsVisualizer> VisualizerParameter {
     76      get { return (OptionalValueParameter<IKnapsackSolutionsVisualizer>)Parameters["Visualizer"]; }
     77    }
    7578    IParameter IProblem.VisualizerParameter {
    76       get { throw new NotImplementedException(); }
    77     }
     79      get { return VisualizerParameter; }
     80    } 
    7881    public OptionalValueParameter<DoubleValue> BestKnownQualityParameter {
    7982      get { return (OptionalValueParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
     
    118121      get { return EvaluatorParameter.Value; }
    119122    }
     123    public IKnapsackSolutionsVisualizer Visualizer {
     124      get { return VisualizerParameter.Value; }
     125      set { VisualizerParameter.Value = value; }
     126    }
    120127    ISolutionsVisualizer IProblem.Visualizer {
    121       get { throw new NotImplementedException(); }
    122     }
     128      get { return VisualizerParameter.Value; }
     129    } 
    123130    public DoubleValue BestKnownQuality {
    124131      get { return BestKnownQualityParameter.Value; }
     
    144151      Parameters.Add(new ValueParameter<IKnapsackEvaluator>("Evaluator", "The operator which should be used to evaluate Knapsack solutions.", evaluator));
    145152      Parameters.Add(new OptionalValueParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this Knapsack instance."));
     153      Parameters.Add(new ValueParameter<IKnapsackSolutionsVisualizer>("Visualizer", "The operator which should be used to visualize Knapsack solutions.", null));
    146154
    147155      creator.BinaryVectorParameter.ActualName = "KnapsackSolution";
     
    223231    void PenaltyParameter_ValueChanged(object sender, EventArgs e) {
    224232      ParameterizeEvaluator();
     233    }
     234    void VisualizerParameter_ValueChanged(object sender, EventArgs e) {
     235      OnVisualizerChanged();
    225236    }
    226237    #endregion
     
    239250      ValuesParameter.Value.Reset += new EventHandler(ValuesValue_Reset);
    240251      PenaltyParameter.ValueChanged += new EventHandler(PenaltyParameter_ValueChanged);
     252      VisualizerParameter.ValueChanged += new EventHandler(VisualizerParameter_ValueChanged);
    241253    }
    242254    private void ParameterizeSolutionCreator() {
Note: See TracChangeset for help on using the changeset viewer.