Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/22/20 03:45:41 (4 years ago)
Author:
abeham
Message:

#2521:

  • Fixed orienteering problem
  • Corrected ParameterizeOperators in all encoding-specific problem base classes
  • Added new interfaces and wiring code to IntegerVectorEncoding
Location:
branches/2521_ProblemRefactoring/HeuristicLab.Encodings.IntegerVectorEncoding/3.3
Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/HeuristicLab.Encodings.IntegerVectorEncoding-3.3.csproj

    r16876 r17620  
    146146    <Compile Include="Interfaces\IIntegerVectorStdDevStrategyParameterManipulator.cs" />
    147147    <Compile Include="Interfaces\IIntegerVectorStdDevStrategyParameterOperator.cs" />
     148    <Compile Include="Interfaces\IIntegerVectorLocalImprovementOperator.cs" />
     149    <Compile Include="Interfaces\IIntegerVectorSolutionOperator.cs" />
     150    <Compile Include="Interfaces\IIntegerVectorSolutionsOperator.cs" />
    148151    <Compile Include="Manipulators\UniformSomePositionsManipulator.cs" />
    149152    <Compile Include="Manipulators\RoundedNormalAllPositionsManipulator.cs" />
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/IntegerVectorEncoding.cs

    r17614 r17620  
    120120        typeof (IIntegerVectorStdDevStrategyParameterOperator),
    121121        typeof (IIntegerVectorMultiNeighborhoodShakingOperator),
     122        typeof (IIntegerVectorLocalImprovementOperator),
     123        typeof (IIntegerVectorSolutionOperator),
     124        typeof (IIntegerVectorSolutionsOperator)
    122125      };
    123126    }
     
    142145      ConfigureShakingOperators(operators.OfType<IIntegerVectorMultiNeighborhoodShakingOperator>());
    143146      ConfigureStrategyVectorOperator(operators.OfType<IIntegerVectorStdDevStrategyParameterOperator>());
     147      ConfigureLocalImprovementOperators(operators.OfType<IIntegerVectorLocalImprovementOperator>());
     148      ConfigureSolutionOperators(operators.OfType<IIntegerVectorSolutionOperator>());
     149      ConfigureSolutionsOperators(operators.OfType<IIntegerVectorSolutionsOperator>());
    144150    }
    145151
     
    217223      }
    218224    }
     225    private void ConfigureLocalImprovementOperators(IEnumerable<IIntegerVectorLocalImprovementOperator> localImprovementOperators) {
     226      // IIntegerVectorLocalImprovementOperator does not contain additional parameters (already contained in IIntegerVectorSolutionOperator)
     227    }
     228    private void ConfigureSolutionOperators(IEnumerable<IIntegerVectorSolutionOperator> solutionOperators) {
     229      foreach (var solutionOperator in solutionOperators) {
     230        solutionOperator.IntegerVectorParameter.ActualName = Name;
     231      }
     232    }
     233    private void ConfigureSolutionsOperators(IEnumerable<IIntegerVectorSolutionsOperator> solutionsOperators) {
     234      foreach (var solutionsOperator in solutionsOperators) {
     235        solutionsOperator.IntegerVectorsParameter.ActualName = Name;
     236      }
     237    }
    219238    #endregion
    220239
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/IntegerVectorMultiObjectiveProblem.cs

    r17612 r17620  
    8686    }
    8787
    88     protected override void OnEncodingChanged() {
    89       base.OnEncodingChanged();
     88    protected override void ParameterizeOperators() {
     89      base.ParameterizeOperators();
    9090      Parameterize();
    9191    }
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/IntegerVectorProblem.cs

    r17612 r17620  
    7272
    7373      Operators.Add(new HammingSimilarityCalculator());
     74      // TODO: These should be added in the SingleObjectiveProblem base class (if they were accessible from there)
    7475      Operators.Add(new QualitySimilarityCalculator());
    7576      Operators.Add(new PopulationSimilarityAnalyzer(Operators.OfType<ISolutionSimilarityCalculator>()));
     
    8687    }
    8788
    88     protected override void OnEncodingChanged() {
    89       base.OnEncodingChanged();
     89    protected override void ParameterizeOperators() {
     90      base.ParameterizeOperators();
    9091      Parameterize();
    9192    }
    9293
    9394    private void Parameterize() {
     95      // TODO: this is done in base class as well (but operators are added at this level of the hierarchy)
    9496      foreach (var similarityCalculator in Operators.OfType<ISolutionSimilarityCalculator>()) {
    9597        similarityCalculator.SolutionVariableName = Encoding.Name;
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/Interfaces/IIntegerVectorMultiNeighborhoodShakingOperator.cs

    r17226 r17620  
    2020#endregion
    2121
     22using HEAL.Attic;
    2223using HeuristicLab.Core;
    23 using HEAL.Attic;
     24using HeuristicLab.Optimization;
    2425
    2526namespace HeuristicLab.Encodings.IntegerVectorEncoding {
    2627  [StorableType("2b21442c-735f-4df3-a163-4e3147cd11a5")]
    27   public interface IIntegerVectorMultiNeighborhoodShakingOperator : IIntegerVectorOperator {
     28  public interface IIntegerVectorMultiNeighborhoodShakingOperator : IIntegerVectorOperator, IMultiNeighborhoodShakingOperator {
    2829    ILookupParameter<IntegerVector> IntegerVectorParameter { get; }
    2930  }
Note: See TracChangeset for help on using the changeset viewer.