Ignore:
Timestamp:
08/26/14 11:12:16 (5 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/LocalImprovement/AlbaLambdaInterchangeLocalImprovementOperator.cs

    r11171 r11300  
    3737  [StorableClass]
    3838  public class AlbaLambdaInterchangeLocalImprovementOperator : VRPOperator, IStochasticOperator, ILocalImprovementOperator {
    39     public Type ProblemType {
    40       get { return typeof(VehicleRoutingProblem); }
    41     }
    42 
    43     [Storable]
    44     private VehicleRoutingProblem problem;
    45     public IProblem Problem {
    46       get { return problem; }
    47       set { problem = (VehicleRoutingProblem)value; }
    48     }
    4939
    5040    public IValueLookupParameter<IntValue> MaximumIterationsParameter {
     
    8474    protected AlbaLambdaInterchangeLocalImprovementOperator(AlbaLambdaInterchangeLocalImprovementOperator original, Cloner cloner)
    8575      : base(original, cloner) {
    86         this.problem = cloner.Clone(original.problem);
    8776    }
    8877    public AlbaLambdaInterchangeLocalImprovementOperator()
     
    10291    }
    10392
    104     public static void Apply(AlbaEncoding solution, int maxIterations, 
     93    public static void Apply(AlbaEncoding solution, int maxIterations,
    10594      int lambda, int samples, IRandom random, IVRPProblemInstance problemInstance, ref double quality, out int evaluatedSolutions) {
    10695      evaluatedSolutions = 0;
     
    120109          }
    121110        }
    122         if (bestMove != null) 
     111        if (bestMove != null)
    123112          AlbaLambdaInterchangeMoveMaker.Apply(solution, bestMove);
    124113      }
Note: See TracChangeset for help on using the changeset viewer.