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.Problems.QuadraticAssignment/3.3/Analyzers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/ProblemRefactoring/HeuristicLab.Problems.QuadraticAssignment/3.3/Analyzers/BestQAPSolutionAnalyzer.cs

    r12012 r13396  
    3636  [Item("BestQAPSolutionAnalyzer", "An operator for analyzing the best solution of Quadratic Assignment Problems.")]
    3737  [StorableClass]
    38   public sealed class BestQAPSolutionAnalyzer : SingleSuccessorOperator, IAnalyzer, ISingleObjectiveOperator {
     38  public sealed class BestQAPSolutionAnalyzer : SingleSuccessorOperator, IAnalyzer, ISingleObjectiveOperator, IPermutationSolutionsOperator {
    3939    public bool EnabledByDefault {
    4040      get { return true; }
    4141    }
    4242
    43     public LookupParameter<BoolValue> MaximizationParameter {
    44       get { return (LookupParameter<BoolValue>)Parameters["Maximization"]; }
     43    public ILookupParameter<BoolValue> MaximizationParameter {
     44      get { return (ILookupParameter<BoolValue>)Parameters["Maximization"]; }
    4545    }
    46     public LookupParameter<DoubleMatrix> DistancesParameter {
    47       get { return (LookupParameter<DoubleMatrix>)Parameters["Distances"]; }
     46    public ILookupParameter<DoubleMatrix> DistancesParameter {
     47      get { return (ILookupParameter<DoubleMatrix>)Parameters["Distances"]; }
    4848    }
    49     public LookupParameter<DoubleMatrix> WeightsParameter {
    50       get { return (LookupParameter<DoubleMatrix>)Parameters["Weights"]; }
     49    public ILookupParameter<DoubleMatrix> WeightsParameter {
     50      get { return (ILookupParameter<DoubleMatrix>)Parameters["Weights"]; }
    5151    }
    52     public ScopeTreeLookupParameter<Permutation> PermutationParameter {
    53       get { return (ScopeTreeLookupParameter<Permutation>)Parameters["Permutation"]; }
     52    public IScopeTreeLookupParameter<Permutation> PermutationsParameter {
     53      get { return (IScopeTreeLookupParameter<Permutation>)Parameters["Permutations"]; }
    5454    }
    55     public ScopeTreeLookupParameter<DoubleValue> QualityParameter {
    56       get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; }
     55    public IScopeTreeLookupParameter<DoubleValue> QualityParameter {
     56      get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; }
    5757    }
    58     public LookupParameter<QAPAssignment> BestSolutionParameter {
    59       get { return (LookupParameter<QAPAssignment>)Parameters["BestSolution"]; }
     58    public ILookupParameter<QAPAssignment> BestSolutionParameter {
     59      get { return (ILookupParameter<QAPAssignment>)Parameters["BestSolution"]; }
    6060    }
    61     public ValueLookupParameter<ResultCollection> ResultsParameter {
    62       get { return (ValueLookupParameter<ResultCollection>)Parameters["Results"]; }
     61    public IValueLookupParameter<ResultCollection> ResultsParameter {
     62      get { return (IValueLookupParameter<ResultCollection>)Parameters["Results"]; }
    6363    }
    64     public LookupParameter<DoubleValue> BestKnownQualityParameter {
    65       get { return (LookupParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
     64    public ILookupParameter<DoubleValue> BestKnownQualityParameter {
     65      get { return (ILookupParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
    6666    }
    67     public LookupParameter<ItemSet<Permutation>> BestKnownSolutionsParameter {
    68       get { return (LookupParameter<ItemSet<Permutation>>)Parameters["BestKnownSolutions"]; }
     67    public ILookupParameter<ItemSet<Permutation>> BestKnownSolutionsParameter {
     68      get { return (ILookupParameter<ItemSet<Permutation>>)Parameters["BestKnownSolutions"]; }
    6969    }
    70     public LookupParameter<Permutation> BestKnownSolutionParameter {
    71       get { return (LookupParameter<Permutation>)Parameters["BestKnownSolution"]; }
     70    public ILookupParameter<Permutation> BestKnownSolutionParameter {
     71      get { return (ILookupParameter<Permutation>)Parameters["BestKnownSolution"]; }
    7272    }
    7373
     
    8383      Parameters.Add(new LookupParameter<DoubleMatrix>("Distances", "The distances between the locations."));
    8484      Parameters.Add(new LookupParameter<DoubleMatrix>("Weights", "The weights between the facilities."));
    85       Parameters.Add(new ScopeTreeLookupParameter<Permutation>("Permutation", "The QAP solutions from which the best solution should be analyzed."));
     85      Parameters.Add(new ScopeTreeLookupParameter<Permutation>("Permutations", "The QAP solutions from which the best solution should be analyzed."));
    8686      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The qualities of the QAP solutions which should be analyzed."));
    8787      Parameters.Add(new LookupParameter<QAPAssignment>("BestSolution", "The best QAP solution."));
     
    109109      DoubleMatrix distances = DistancesParameter.ActualValue;
    110110      DoubleMatrix weights = WeightsParameter.ActualValue;
    111       ItemArray<Permutation> permutations = PermutationParameter.ActualValue;
     111      ItemArray<Permutation> permutations = PermutationsParameter.ActualValue;
    112112      ItemArray<DoubleValue> qualities = QualityParameter.ActualValue;
    113113      ResultCollection results = ResultsParameter.ActualValue;
  • branches/ProblemRefactoring/HeuristicLab.Problems.QuadraticAssignment/3.3/Analyzers/QAPAlleleFrequencyAnalyzer.cs

    r12012 r13396  
    3636  [StorableClass]
    3737  public sealed class QAPAlleleFrequencyAnalyzer : AlleleFrequencyAnalyzer<Permutation> {
    38     public LookupParameter<DoubleMatrix> WeightsParameter {
    39       get { return (LookupParameter<DoubleMatrix>)Parameters["Weights"]; }
     38    public ILookupParameter<DoubleMatrix> WeightsParameter {
     39      get { return (ILookupParameter<DoubleMatrix>)Parameters["Weights"]; }
    4040    }
    41     public LookupParameter<DoubleMatrix> DistancesParameter {
    42       get { return (LookupParameter<DoubleMatrix>)Parameters["Distances"]; }
     41    public ILookupParameter<DoubleMatrix> DistancesParameter {
     42      get { return (ILookupParameter<DoubleMatrix>)Parameters["Distances"]; }
    4343    }
    4444
Note: See TracChangeset for help on using the changeset viewer.