Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/26/15 09:30:43 (9 years ago)
Author:
abeham
Message:

#2521:

  • Adapted Knapsack problem to new problem infrastructure
  • Introduced additional interfaces in binary vector encoding
  • Improved KnapsackImprovementOperator which requires less evaluated solutions in case of an infeasible start solution

Loosely related change:

  • All LookupParameters are now shown by default
  • Wiring code should make sure that wired parameters are hidden
Location:
branches/ProblemRefactoring/HeuristicLab.Encodings.BinaryVectorEncoding/3.3
Files:
2 added
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/ProblemRefactoring/HeuristicLab.Encodings.BinaryVectorEncoding/3.3

    • Property svn:ignore
      •  

        old new  
        55*.vs10x
        66Plugin.cs
         7*.DotSettings
  • branches/ProblemRefactoring/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/BinaryVectorEncoding.cs

    r13396 r13404  
    5252    }
    5353    #endregion
    54 
    5554
    5655    public int Length {
     
    108107        typeof (IBinaryVectorMoveOperator),
    109108        typeof (IBinaryVectorMultiNeighborhoodShakingOperator),
     109        typeof (IBinaryVectorSolutionOperator),
     110        typeof (IBinaryVectorSolutionsOperator)
    110111      };
    111112    }
     
    129130      ConfigureBitFlipMoveOperators(operators.OfType<IOneBitflipMoveOperator>());
    130131      ConfigureShakingOperators(operators.OfType<IBinaryVectorMultiNeighborhoodShakingOperator>());
     132      ConfigureSolutionOperators(operators.OfType<IBinaryVectorSolutionOperator>());
     133      ConfigureSolutionsOperators(operators.OfType<IBinaryVectorSolutionsOperator>());
    131134    }
    132135
     
    134137    private void ConfigureCreators(IEnumerable<IBinaryVectorCreator> creators) {
    135138      foreach (var creator in creators) {
    136         creator.BinaryVectorParameter.ActualName = Name;
    137139        creator.LengthParameter.ActualName = LengthParameter.Name;
    138140      }
     
    145147    }
    146148    private void ConfigureManipulators(IEnumerable<IBinaryVectorManipulator> manipulators) {
    147       foreach (var manipulator in manipulators) {
    148         manipulator.BinaryVectorParameter.ActualName = Name;
    149       }
     149      // binary vector manipulators don't contain additional parameters besides the solution parameter
    150150    }
    151151    private void ConfigureMoveOperators(IEnumerable<IBinaryVectorMoveOperator> moveOperators) {
    152       foreach (var moveOperator in moveOperators) {
    153         moveOperator.BinaryVectorParameter.ActualName = Name;
    154       }
     152      // binary vector move operators don't contain additional parameters besides the solution parameter
    155153    }
    156154    private void ConfigureBitFlipMoveOperators(IEnumerable<IOneBitflipMoveOperator> oneBitflipMoveOperators) {
     
    160158    }
    161159    private void ConfigureShakingOperators(IEnumerable<IBinaryVectorMultiNeighborhoodShakingOperator> shakingOperators) {
    162       foreach (var shakingOperator in shakingOperators) {
    163         shakingOperator.BinaryVectorParameter.ActualName = Name;
    164       }
     160      // binary vector shaking operators don't contain additional parameters besides the solution parameter
     161    }
     162    private void ConfigureSolutionOperators(IEnumerable<IBinaryVectorSolutionOperator> solutionOperators) {
     163      foreach (var solutionOperator in solutionOperators)
     164        solutionOperator.BinaryVectorParameter.ActualName = Name;
     165    }
     166    private void ConfigureSolutionsOperators(IEnumerable<IBinaryVectorSolutionsOperator> solutionsOperators) {
     167      foreach (var solutionsOperator in solutionsOperators)
     168        solutionsOperator.BinaryVectorsParameter.ActualName = Name;
    165169    }
    166170    #endregion
  • branches/ProblemRefactoring/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/HeuristicLab.Encodings.BinaryVectorEncoding-3.3.csproj

    r11961 r13404  
    127127    <Compile Include="BinaryVector.cs" />
    128128    <Compile Include="Interfaces\IBinaryVectorMultiNeighborhoodShakingOperator.cs" />
     129    <Compile Include="Interfaces\IBinaryVectorSolutionsOperator.cs" />
     130    <Compile Include="Interfaces\IBinaryVectorSolutionOperator.cs" />
     131    <Compile Include="Interfaces\IOneBitflipMoveQualityOperator.cs" />
    129132    <Compile Include="Interfaces\IOneBitflipMoveOperator.cs" />
    130133    <Compile Include="Interfaces\IBinaryVectorCreator.cs" />
  • branches/ProblemRefactoring/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Interfaces/IBinaryVectorCreator.cs

    r13336 r13404  
    2828  /// An interface which represents an operator for creating vectors of bool-valued data.
    2929  /// </summary>
    30   public interface IBinaryVectorCreator : IBinaryVectorOperator, ISolutionCreator<BinaryVector> {
     30  public interface IBinaryVectorCreator : IBinaryVectorSolutionOperator, ISolutionCreator<BinaryVector> {
    3131    IValueLookupParameter<IntValue> LengthParameter { get; }
    32     ILookupParameter<BinaryVector> BinaryVectorParameter { get; }
    3332  }
    3433}
  • branches/ProblemRefactoring/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Interfaces/IBinaryVectorManipulator.cs

    r12012 r13404  
    2020#endregion
    2121
    22 using HeuristicLab.Core;
    2322using HeuristicLab.Optimization;
    2423
     
    2726  /// An interface which represents an operator for manipulating vectors of bool-valued data.
    2827  /// </summary>
    29   public interface IBinaryVectorManipulator : IBinaryVectorOperator, IManipulator {
    30     ILookupParameter<BinaryVector> BinaryVectorParameter { get; }
     28  public interface IBinaryVectorManipulator : IBinaryVectorSolutionOperator, IManipulator {
    3129  }
    3230}
  • branches/ProblemRefactoring/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Interfaces/IBinaryVectorMoveOperator.cs

    r12012 r13404  
    2020#endregion
    2121
    22 using HeuristicLab.Core;
    2322using HeuristicLab.Optimization;
    2423
    2524namespace HeuristicLab.Encodings.BinaryVectorEncoding {
    26   public interface IBinaryVectorMoveOperator : IBinaryVectorOperator, IMoveOperator {
    27     ILookupParameter<BinaryVector> BinaryVectorParameter { get; }
     25  public interface IBinaryVectorMoveOperator : IBinaryVectorSolutionOperator, IMoveOperator {
    2826  }
    2927}
  • branches/ProblemRefactoring/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Interfaces/IBinaryVectorMultiNeighborhoodShakingOperator.cs

    r12012 r13404  
    2020#endregion
    2121
    22 using HeuristicLab.Core;
    2322
    2423namespace HeuristicLab.Encodings.BinaryVectorEncoding {
    25   public interface IBinaryVectorMultiNeighborhoodShakingOperator : IBinaryVectorOperator {
    26     ILookupParameter<BinaryVector> BinaryVectorParameter { get; }
     24  public interface IBinaryVectorMultiNeighborhoodShakingOperator : IBinaryVectorSolutionOperator {
    2725  }
    2826}
  • branches/ProblemRefactoring/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Interfaces/IOneBitflipMoveQualityOperator.cs

    r13402 r13404  
    2121
    2222using HeuristicLab.Core;
     23using HeuristicLab.Data;
    2324
    2425namespace HeuristicLab.Encodings.BinaryVectorEncoding {
    25   public interface IOneBitflipMoveOperator : IBinaryVectorMoveOperator {
    26     ILookupParameter<OneBitflipMove> OneBitflipMoveParameter { get; }
     26  public interface IOneBitflipMoveQualityOperator : IOneBitflipMoveOperator {
     27    ILookupParameter<DoubleValue> MoveQualityParameter { get; }
    2728  }
    2829}
  • branches/ProblemRefactoring/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Moves/OneBitflipMove/OneBitflipMoveMaker.cs

    r12012 r13404  
    3131  [Item("OneBitflipMoveMaker", "Peforms a one bitflip move on a given BitVector and updates the quality.")]
    3232  [StorableClass]
    33   public class OneBitflipMoveMaker : SingleSuccessorOperator, IOneBitflipMoveOperator, IMoveMaker, ISingleObjectiveOperator {
     33  public class OneBitflipMoveMaker : SingleSuccessorOperator, IOneBitflipMoveQualityOperator, IMoveMaker, ISingleObjectiveOperator {
    3434    public override bool CanChangeName {
    3535      get { return false; }
  • branches/ProblemRefactoring/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Moves/OneBitflipMove/OneBitflipMoveTabuChecker.cs

    r12012 r13404  
    3131  [Item("OneBitflipMoveTabuChecker", "Prevents peforming a one bitflip move again.")]
    3232  [StorableClass]
    33   public class OneBitflipMoveTabuChecker : SingleSuccessorOperator, IOneBitflipMoveOperator, ITabuChecker {
     33  public class OneBitflipMoveTabuChecker : SingleSuccessorOperator, IOneBitflipMoveQualityOperator, ITabuChecker {
    3434    public override bool CanChangeName {
    3535      get { return false; }
  • branches/ProblemRefactoring/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Moves/OneBitflipMove/OneBitflipMoveTabuMaker.cs

    r12012 r13404  
    2929  [Item("OneBitflipMoveTabuMaker", "Declares a given one bitflip move as tabu, by adding its attributes to the tabu list. It also removes the oldest entry in the tabu list when its size is greater than tenure.")]
    3030  [StorableClass]
    31   public class OneBitflipMoveTabuMaker : TabuMaker, IOneBitflipMoveOperator {
     31  public class OneBitflipMoveTabuMaker : TabuMaker, IOneBitflipMoveQualityOperator {
    3232    public ILookupParameter<BinaryVector> BinaryVectorParameter {
    3333      get { return (ILookupParameter<BinaryVector>)Parameters["BinaryVector"]; }
Note: See TracChangeset for help on using the changeset viewer.