Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/25/15 16:22:37 (9 years ago)
Author:
abeham
Message:

#2521:

  • Refactored QuadraticAssignmentProblem to use new SingleObjectiveProblem
    • Removed QAPEvaluator
    • Adapted RobustTabooSearch
  • Introduced several interfaces in PermutationEncoding necessary for wiring
  • Changed all Encodings to use IItem instead of IOperator in ConfigureOperators (name still unchanged)
  • Added a protected MaximizationParameter property in SingleObjectiveProblem (necessary for wiring)
  • Changed AlleleFrequnencyAnalyzer to use ISolution interface instead of IItem
  • Added a comment to ISolutionCreator<TSolution> of some changes that would be welcomed
Location:
branches/ProblemRefactoring/HeuristicLab.Optimization/3.3
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/CombinedEncoding.cs

    r13376 r13396  
    8888    }
    8989
    90     public override void ConfigureOperators(IEnumerable<IOperator> operators) {
     90    public override void ConfigureOperators(IEnumerable<IItem> operators) {
    9191      foreach (var encOp in operators.OfType<IMultiEncodingOperator>())
    9292        encOp.SolutionParameter.ActualName = Name;
  • branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Encoding.cs

    r13351 r13396  
    100100    }
    101101
    102     public void ConfigureOperator(IOperator @operator) { ConfigureOperators(new[] { @operator }); }
    103     public abstract void ConfigureOperators(IEnumerable<IOperator> operators);
     102    public void ConfigureOperator(IItem @operator) { ConfigureOperators(new[] { @operator }); }
     103    public abstract void ConfigureOperators(IEnumerable<IItem> operators);
    104104
    105105    public event EventHandler SolutionCreatorChanged;
  • branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/IEncoding.cs

    r13351 r13396  
    2929    IEnumerable<IOperator> Operators { get; set; }
    3030
    31     void ConfigureOperator(IOperator @operator);
    32     void ConfigureOperators(IEnumerable<IOperator> operators);
     31    void ConfigureOperator(IItem @operator);
     32    void ConfigureOperators(IEnumerable<IItem> operators);
    3333
    3434    event EventHandler SolutionCreatorChanged;
  • branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Problem.cs

    r13376 r13396  
    3535    where TEvaluator : class, IEvaluator {
    3636
    37     public string Filename { get; set; }
     37    public string Filename { get; set; } // TODO: Really okay here?
    3838
    3939    protected IValueParameter<TEncoding> EncodingParameter {
     
    7171        Parameterize();
    7272      }
     73      RegisterEvents();
     74    }
     75    protected Problem(TEncoding encoding) {
     76      if (encoding == null) throw new ArgumentNullException("encoding");
     77      Parameters.Add(new ValueParameter<TEncoding>("Encoding", "Describes the configuration of the encoding, what the variables are called, what type they are and their bounds if any.", encoding));
     78      oldEncoding = Encoding;
     79      SolutionCreator = Encoding.SolutionCreator;
     80      Parameterize();
     81
    7382      RegisterEvents();
    7483    }
  • branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/SingleObjectiveProblem.cs

    r13388 r13396  
    4141    }
    4242
     43    protected IFixedValueParameter<BoolValue> MaximizationParameter {
     44      get { return (IFixedValueParameter<BoolValue>)Parameters["Maximization"]; }
     45    }
     46
    4347    public double BestKnownQuality {
    4448      get {
     
    6266    protected SingleObjectiveProblem()
    6367      : base() {
     68      Parameters.Add(new FixedValueParameter<BoolValue>("Maximization", "Set to false if the problem should be minimized.", (BoolValue)new BoolValue(Maximization).AsReadOnly()) { Hidden = true });
     69      Parameters.Add(new OptionalValueParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this problem."));
     70
     71      Operators.Add(Evaluator);
     72      Operators.Add(new SingleObjectiveAnalyzer<TSolution>());
     73      Operators.Add(new SingleObjectiveImprover<TSolution>());
     74      Operators.Add(new SingleObjectiveMoveEvaluator<TSolution>());
     75      Operators.Add(new SingleObjectiveMoveGenerator<TSolution>());
     76      Operators.Add(new SingleObjectiveMoveMaker<TSolution>());
     77
     78      ParameterizeOperators();
     79    }
     80
     81    protected SingleObjectiveProblem(TEncoding encoding)
     82      : base(encoding) {
    6483      Parameters.Add(new FixedValueParameter<BoolValue>("Maximization", "Set to false if the problem should be minimized.", (BoolValue)new BoolValue(Maximization).AsReadOnly()) { Hidden = true });
    6584      Parameters.Add(new OptionalValueParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this problem."));
  • branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/Interfaces/ISolutionCreator.cs

    r13336 r13396  
    2828  public interface ISolutionCreator : IOperator { }
    2929
    30   public interface ISolutionCreator<TSolution> : ISolutionCreator where TSolution : class, ISolution { }
     30  public interface ISolutionCreator<TSolution> : ISolutionCreator where TSolution : class, ISolution {
     31    //ILookupParameter<TSolution> SolutionParameter { get; } // TODO: unify encoding specific parameters by defining ISolutionOperator and ISolutionsOperator
     32  }
    3133}
Note: See TracChangeset for help on using the changeset viewer.