Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/26/14 11:12:16 (10 years ago)
Author:
pfleck
Message:

#2232
Introduced ILocalImprovementAlgorithmOperator to separate single operators for local improvement and operator graphs/algorithms for local improvement.
This way the ILocalImprovementOperator does not have to specify a problem type and does not store a problem any more.

The LocalSearchImprovementOperator and SimulatedAnnealingImprovementOperator implement the new ILocalImprovementAlgorithmOperator as they represent an operator graph for local improvement.
The QAP and VRP local improvement operators implement the ILocalImprovementOperator which does not store a problem anymore.

Location:
trunk/sources/HeuristicLab.Problems.QuadraticAssignment/3.3
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.QuadraticAssignment/3.3/LocalImprovement/QAPExhaustiveInsertionLocalImprovement.cs

    r11171 r11300  
    3535  [StorableClass]
    3636  public class QAPExhaustiveInsertionLocalImprovement : SingleSuccessorOperator, ILocalImprovementOperator {
    37 
    38     public Type ProblemType {
    39       get { return typeof(QuadraticAssignmentProblem); }
    40     }
    41 
    42     [Storable]
    43     private QuadraticAssignmentProblem problem;
    44     public IProblem Problem {
    45       get { return problem; }
    46       set { problem = (QuadraticAssignmentProblem)value; }
    47     }
    4837
    4938    public ILookupParameter<IntValue> LocalIterationsParameter {
     
    8776    protected QAPExhaustiveInsertionLocalImprovement(QAPExhaustiveInsertionLocalImprovement original, Cloner cloner)
    8877      : base(original, cloner) {
    89       this.problem = cloner.Clone(original.problem);
    9078    }
    9179    public QAPExhaustiveInsertionLocalImprovement()
  • trunk/sources/HeuristicLab.Problems.QuadraticAssignment/3.3/LocalImprovement/QAPExhaustiveInversionLocalImprovement.cs

    r11171 r11300  
    3535  [StorableClass]
    3636  public class QAPExhaustiveInversionLocalImprovement : SingleSuccessorOperator, ILocalImprovementOperator {
    37 
    38     public Type ProblemType {
    39       get { return typeof(QuadraticAssignmentProblem); }
    40     }
    41 
    42     [Storable]
    43     private QuadraticAssignmentProblem problem;
    44     public IProblem Problem {
    45       get { return problem; }
    46       set { problem = (QuadraticAssignmentProblem)value; }
    47     }
    4837
    4938    public ILookupParameter<IntValue> LocalIterationsParameter {
     
    8776    protected QAPExhaustiveInversionLocalImprovement(QAPExhaustiveInversionLocalImprovement original, Cloner cloner)
    8877      : base(original, cloner) {
    89       this.problem = cloner.Clone(original.problem);
    9078    }
    9179    public QAPExhaustiveInversionLocalImprovement()
  • trunk/sources/HeuristicLab.Problems.QuadraticAssignment/3.3/LocalImprovement/QAPExhaustiveSwap2LocalImprovement.cs

    r11171 r11300  
    3535  [StorableClass]
    3636  public class QAPExhaustiveSwap2LocalImprovement : SingleSuccessorOperator, ILocalImprovementOperator {
    37 
    38     public Type ProblemType {
    39       get { return typeof(QuadraticAssignmentProblem); }
    40     }
    41 
    42     [Storable]
    43     private QuadraticAssignmentProblem problem;
    44     public IProblem Problem {
    45       get { return problem; }
    46       set { problem = (QuadraticAssignmentProblem)value; }
    47     }
    4837
    4938    public ILookupParameter<IntValue> LocalIterationsParameter {
     
    9180    protected QAPExhaustiveSwap2LocalImprovement(QAPExhaustiveSwap2LocalImprovement original, Cloner cloner)
    9281      : base(original, cloner) {
    93       this.problem = cloner.Clone(original.problem);
    9482    }
    9583    public QAPExhaustiveSwap2LocalImprovement()
  • trunk/sources/HeuristicLab.Problems.QuadraticAssignment/3.3/LocalImprovement/QAPStochasticScrambleLocalImprovement.cs

    r11171 r11300  
    3535  [StorableClass]
    3636  public class QAPStochasticScrambleLocalImprovement : SingleSuccessorOperator, ILocalImprovementOperator, IStochasticOperator {
    37 
    38     public Type ProblemType {
    39       get { return typeof(QuadraticAssignmentProblem); }
    40     }
    41 
    42     [Storable]
    43     private QuadraticAssignmentProblem problem;
    44     public IProblem Problem {
    45       get { return problem; }
    46       set { problem = (QuadraticAssignmentProblem)value; }
    47     }
    4837
    4938    public ILookupParameter<IntValue> LocalIterationsParameter {
     
    9584    protected QAPStochasticScrambleLocalImprovement(QAPStochasticScrambleLocalImprovement original, Cloner cloner)
    9685      : base(original, cloner) {
    97       this.problem = cloner.Clone(original.problem);
    9886    }
    9987    public QAPStochasticScrambleLocalImprovement()
  • trunk/sources/HeuristicLab.Problems.QuadraticAssignment/3.3/QuadraticAssignmentProblem.cs

    r11171 r11300  
    302302      Operators.Add(new QAPAlleleFrequencyAnalyzer());
    303303      Operators.Add(new QAPPopulationDiversityAnalyzer());
     304
     305      Operators.Add(new QAPExhaustiveInsertionLocalImprovement());
     306      Operators.Add(new QAPExhaustiveInversionLocalImprovement());
     307      Operators.Add(new QAPStochasticScrambleLocalImprovement());
    304308      Operators.Add(new QAPExhaustiveSwap2LocalImprovement());
     309
    305310      Operators.Add(new QAPSimilarityCalculator());
    306311      ParameterizeAnalyzers();
Note: See TracChangeset for help on using the changeset viewer.