Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/14/10 03:52:07 (14 years ago)
Author:
abeham
Message:

Updated Tabu search, permutation move operators, real vector move operators, binary vector move operators #840
Added a Tabu Search TSP workbench

File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveMoveTabuMaker.cs

    r3339 r3340  
    2929
    3030namespace HeuristicLab.Encodings.RealVectorEncoding {
    31   [Item("AdditiveTabuMoveMaker", "Sets the move tabu.")]
     31  [Item("AdditiveMoveTabuMaker", "Sets the move tabu.")]
    3232  [StorableClass]
    33   public class AdditiveTabuMoveMaker : TabuMaker, IAdditiveRealVectorMoveOperator {
     33  public class AdditiveMoveTabuMaker : TabuMaker, IAdditiveRealVectorMoveOperator {
    3434    public ILookupParameter<AdditiveMove> AdditiveMoveParameter {
    3535      get { return (ILookupParameter<AdditiveMove>)Parameters["AdditiveMove"]; }
     
    3939    }
    4040
    41     public AdditiveTabuMoveMaker()
     41    public AdditiveMoveTabuMaker()
    4242      : base() {
    4343      Parameters.Add(new LookupParameter<AdditiveMove>("AdditiveMove", "The move to evaluate."));
     
    4545    }
    4646
    47     protected override IItem GetTabuAttribute() {
     47    protected override IItem GetTabuAttribute(bool maximization, double quality, double moveQuality) {
    4848      AdditiveMove move = AdditiveMoveParameter.ActualValue;
    4949      RealVector vector = RealVectorParameter.ActualValue;
    50       return new AdditiveMoveTabuAttribute(move.Dimension, vector[move.Dimension], vector[move.Dimension] + move.MoveDistance);
     50      double baseQuality = moveQuality;
     51      if (maximization && quality > moveQuality || !maximization && quality < moveQuality) baseQuality = quality;
     52      return new AdditiveMoveTabuAttribute(move.Dimension, vector[move.Dimension], vector[move.Dimension] + move.MoveDistance, baseQuality);
    5153    }
    5254   
Note: See TracChangeset for help on using the changeset viewer.