Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/07/11 14:23:26 (14 years ago)
Author:
mkommend
Message:

#1418: Added symbolic data analysis problems.

File:
1 copied

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisMultiObjectiveProblem.cs

    r5598 r5618  
    2020#endregion
    2121
     22using System.Linq;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
     
    2930namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    3031  [StorableClass]
    31   public abstract class MultiObjectiveSymbolicDataAnalysisProblem<T, U, V> : SymbolicDataAnalysisProblem<T, U, V>, IMultiObjectiveHeuristicOptimizationProblem
     32  public abstract class SymbolicDataAnalysisMultiObjectiveProblem<T, U, V> : SymbolicDataAnalysisProblem<T, U, V>, IMultiObjectiveHeuristicOptimizationProblem
    3233    where T : class,IDataAnalysisProblemData
    33     where U : class, ISymbolicDataAnalysisEvaluator<T>, IMultiObjectiveEvaluator
     34    where U : class, ISymbolicDataAnalysisMultiObjectiveEvaluator<T>
    3435    where V : class, ISymbolicDataAnalysisSolutionCreator {
    3536    private const string MaximizationParameterName = "Maximization";
     
    3738
    3839    #region parameter properties
    39     public ValueParameter<BoolArray> MaximizationParameter {
    40       get { return (ValueParameter<BoolArray>)Parameters[MaximizationParameterName]; }
     40    public IValueParameter<BoolArray> MaximizationParameter {
     41      get { return (IValueParameter<BoolArray>)Parameters[MaximizationParameterName]; }
    4142    }
    4243    IParameter IMultiObjectiveHeuristicOptimizationProblem.MaximizationParameter {
     
    4849    public BoolArray Maximization {
    4950      get { return MaximizationParameter.Value; }
    50       protected set { MaximizationParameter.Value = value; }
     51      set { MaximizationParameter.Value = value; }
    5152    }
    5253    IMultiObjectiveEvaluator IMultiObjectiveHeuristicOptimizationProblem.Evaluator {
     
    5657
    5758    [StorableConstructor]
    58     protected MultiObjectiveSymbolicDataAnalysisProblem(bool deserializing) : base(deserializing) { }
    59     protected MultiObjectiveSymbolicDataAnalysisProblem(MultiObjectiveSymbolicDataAnalysisProblem<T, U, V> original, Cloner cloner) : base(original, cloner) { }
     59    protected SymbolicDataAnalysisMultiObjectiveProblem(bool deserializing) : base(deserializing) { }
     60    protected SymbolicDataAnalysisMultiObjectiveProblem(SymbolicDataAnalysisMultiObjectiveProblem<T, U, V> original, Cloner cloner) : base(original, cloner) { }
    6061
    61     public MultiObjectiveSymbolicDataAnalysisProblem()
    62       : base() {
     62    public SymbolicDataAnalysisMultiObjectiveProblem(T problemData, U evaluator, V solutionCreator)
     63      : base(problemData, evaluator, solutionCreator) {
    6364      Parameters.Add(new ValueParameter<BoolArray>(MaximizationParameterName, "Set to false if the problem should be minimized."));
     65    }
     66
     67    protected override void OnEvaluatorChanged() {
     68      base.OnEvaluatorChanged();
     69      Maximization = new BoolArray(Evaluator.Maximization.ToArray());
    6470    }
    6571  }
Note: See TracChangeset for help on using the changeset viewer.