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/LocalImprovement
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/ProblemRefactoring/HeuristicLab.Problems.QuadraticAssignment/3.3/LocalImprovement/QAPExhaustiveInsertionLocalImprovement.cs

    r12012 r13396  
    3434  [Item("QAPExhaustiveInsertionLocalImprovement", "Takes a solution and finds the local optimum with respect to the insertion neighborhood by decending along the steepest gradient.")]
    3535  [StorableClass]
    36   public class QAPExhaustiveInsertionLocalImprovement : SingleSuccessorOperator, ILocalImprovementOperator, ISingleObjectiveOperator {
     36  public class QAPExhaustiveInsertionLocalImprovement : SingleSuccessorOperator, IQAPLocalImprovementOperator, ISingleObjectiveOperator {
    3737
    3838    public ILookupParameter<IntValue> LocalIterationsParameter {
     
    5252    }
    5353
    54     public ILookupParameter<Permutation> AssignmentParameter {
    55       get { return (ILookupParameter<Permutation>)Parameters["Assignment"]; }
     54    public ILookupParameter<Permutation> PermutationParameter {
     55      get { return (ILookupParameter<Permutation>)Parameters["Permutation"]; }
    5656    }
    5757
     
    8383      Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The amount of evaluated solutions (here a move is counted only as 4/n evaluated solutions with n being the length of the permutation)."));
    8484      Parameters.Add(new LookupParameter<ResultCollection>("Results", "The collection where to store results."));
    85       Parameters.Add(new LookupParameter<Permutation>("Assignment", "The permutation that is to be locally optimized."));
     85      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The permutation that is to be locally optimized."));
    8686      Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality value of the assignment."));
    8787      Parameters.Add(new LookupParameter<BoolValue>("Maximization", "True if the problem should be maximized or minimized."));
     
    122122    public override IOperation Apply() {
    123123      var maxIterations = MaximumIterationsParameter.ActualValue.Value;
    124       var assignment = AssignmentParameter.ActualValue;
     124      var assignment = PermutationParameter.ActualValue;
    125125      var maximization = MaximizationParameter.ActualValue.Value;
    126126      var weights = WeightsParameter.ActualValue;
  • branches/ProblemRefactoring/HeuristicLab.Problems.QuadraticAssignment/3.3/LocalImprovement/QAPExhaustiveInversionLocalImprovement.cs

    r12811 r13396  
    3434  [Item("QAPExhaustiveInversionLocalImprovement", "Takes a solution and finds the local optimum with respect to the inversion neighborhood by decending along the steepest gradient.")]
    3535  [StorableClass]
    36   public class QAPExhaustiveInversionLocalImprovement : SingleSuccessorOperator, ILocalImprovementOperator, ISingleObjectiveOperator {
     36  public class QAPExhaustiveInversionLocalImprovement : SingleSuccessorOperator, IQAPLocalImprovementOperator, ISingleObjectiveOperator {
    3737
    3838    public ILookupParameter<IntValue> LocalIterationsParameter {
     
    5252    }
    5353
    54     public ILookupParameter<Permutation> AssignmentParameter {
    55       get { return (ILookupParameter<Permutation>)Parameters["Assignment"]; }
     54    public ILookupParameter<Permutation> PermutationParameter {
     55      get { return (ILookupParameter<Permutation>)Parameters["Permutation"]; }
    5656    }
    5757
     
    8383      Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The amount of evaluated solutions (here a move is counted only as 4/n evaluated solutions with n being the length of the permutation)."));
    8484      Parameters.Add(new LookupParameter<ResultCollection>("Results", "The collection where to store results."));
    85       Parameters.Add(new LookupParameter<Permutation>("Assignment", "The permutation that is to be locally optimized."));
     85      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The permutation that is to be locally optimized."));
    8686      Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality value of the assignment."));
    8787      Parameters.Add(new LookupParameter<BoolValue>("Maximization", "True if the problem should be maximized or minimized."));
     
    119119    public override IOperation Apply() {
    120120      var maxIterations = MaximumIterationsParameter.ActualValue.Value;
    121       var assignment = AssignmentParameter.ActualValue;
     121      var assignment = PermutationParameter.ActualValue;
    122122      var maximization = MaximizationParameter.ActualValue.Value;
    123123      var weights = WeightsParameter.ActualValue;
  • branches/ProblemRefactoring/HeuristicLab.Problems.QuadraticAssignment/3.3/LocalImprovement/QAPExhaustiveSwap2LocalImprovement.cs

    r12012 r13396  
    3434  [Item("QAPExhaustiveSwap2LocalImprovement", "Takes a solution and finds the local optimum with respect to the swap2 neighborhood by decending along the steepest gradient.")]
    3535  [StorableClass]
    36   public class QAPExhaustiveSwap2LocalImprovement : SingleSuccessorOperator, ILocalImprovementOperator, ISingleObjectiveOperator {
     36  public class QAPExhaustiveSwap2LocalImprovement : SingleSuccessorOperator, IQAPLocalImprovementOperator, ISingleObjectiveOperator {
    3737
    3838    public ILookupParameter<IntValue> LocalIterationsParameter {
     
    5252    }
    5353
    54     public ILookupParameter<Permutation> AssignmentParameter {
    55       get { return (ILookupParameter<Permutation>)Parameters["Assignment"]; }
     54    public ILookupParameter<Permutation> PermutationParameter {
     55      get { return (ILookupParameter<Permutation>)Parameters["Permutation"]; }
    5656    }
    5757
     
    8787      Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The amount of evaluated solutions (here a move is counted only as 4/n evaluated solutions with n being the length of the permutation)."));
    8888      Parameters.Add(new LookupParameter<ResultCollection>("Results", "The collection where to store results."));
    89       Parameters.Add(new LookupParameter<Permutation>("Assignment", "The permutation that is to be locally optimized."));
     89      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The permutation that is to be locally optimized."));
    9090      Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality value of the assignment."));
    9191      Parameters.Add(new LookupParameter<BoolValue>("Maximization", "True if the problem should be maximized or minimized."));
     
    175175    public override IOperation Apply() {
    176176      var maxIterations = MaximumIterationsParameter.ActualValue.Value;
    177       var assignment = AssignmentParameter.ActualValue;
     177      var assignment = PermutationParameter.ActualValue;
    178178      var maximization = MaximizationParameter.ActualValue.Value;
    179179      var weights = WeightsParameter.ActualValue;
  • branches/ProblemRefactoring/HeuristicLab.Problems.QuadraticAssignment/3.3/LocalImprovement/QAPStochasticScrambleLocalImprovement.cs

    r12811 r13396  
    3434  [Item("QAPStochasticScrambleLocalImprovement", "Takes a solution and finds the local optimum with respect to the scramble neighborhood by decending along the steepest gradient.")]
    3535  [StorableClass]
    36   public class QAPStochasticScrambleLocalImprovement : SingleSuccessorOperator, ILocalImprovementOperator, IStochasticOperator, ISingleObjectiveOperator {
     36  public class QAPStochasticScrambleLocalImprovement : SingleSuccessorOperator, IQAPLocalImprovementOperator, IStochasticOperator, ISingleObjectiveOperator {
    3737
    3838    public ILookupParameter<IntValue> LocalIterationsParameter {
     
    5656    }
    5757
    58     public ILookupParameter<Permutation> AssignmentParameter {
    59       get { return (ILookupParameter<Permutation>)Parameters["Assignment"]; }
     58    public ILookupParameter<Permutation> PermutationParameter {
     59      get { return (ILookupParameter<Permutation>)Parameters["Permutation"]; }
    6060    }
    6161
     
    9292      Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The amount of evaluated solutions (here a move is counted only as 4/n evaluated solutions with n being the length of the permutation)."));
    9393      Parameters.Add(new LookupParameter<ResultCollection>("Results", "The collection where to store results."));
    94       Parameters.Add(new LookupParameter<Permutation>("Assignment", "The permutation that is to be locally optimized."));
     94      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The permutation that is to be locally optimized."));
    9595      Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality value of the assignment."));
    9696      Parameters.Add(new LookupParameter<BoolValue>("Maximization", "True if the problem should be maximized or minimized."));
     
    132132      var maxIterations = MaximumIterationsParameter.ActualValue.Value;
    133133      var neighborhoodSize = NeighborhoodSizeParameter.ActualValue.Value;
    134       var assignment = AssignmentParameter.ActualValue;
     134      var assignment = PermutationParameter.ActualValue;
    135135      var maximization = MaximizationParameter.ActualValue.Value;
    136136      var weights = WeightsParameter.ActualValue;
Note: See TracChangeset for help on using the changeset viewer.