Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/16/10 21:29:10 (15 years ago)
Author:
abeham
Message:

updated tabu search #840

Location:
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves
Files:
8 added
3 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/StochasticTwoOptMoveGenerator.cs

    r3053 r3074  
    3838    }
    3939
     40    public IntValue SampleSize {
     41      get { return SampleSizeParameter.Value; }
     42      set { SampleSizeParameter.Value = value; }
     43    }
     44
    4045    public StochasticTwoOptMoveGenerator()
    4146      : base() {
     
    5055      TwoOptMove[] moves = new TwoOptMove[sampleSize];
    5156      for (int i = 0; i < sampleSize; i++) {
    52         int index1 = random.Next(length - 1);
    53         int index2 = random.Next(index1 + 1, length);
     57        int index1 = random.Next(length - 1), index2;
     58        if (index1 >= 2)
     59          index2 = random.Next(index1 + 1, length);
     60        else index2 = random.Next(index1 + 1, length - (2 - index1));
    5461        moves[i] = new TwoOptMove(index1, index2);
    5562      }
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/TwoOptMoveGenerator.cs

    r3053 r3074  
    3535    }
    3636    public ILookupParameter<TwoOptMove> TwoOptMoveParameter {
    37       get { return (LookupParameter<TwoOptMove>)Parameters["Move"]; }
     37      get { return (LookupParameter<TwoOptMove>)Parameters["TwoOptMove"]; }
    3838    }
    3939    protected ScopeParameter CurrentScopeParameter {
     
    4444      : base() {
    4545      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The permutation for which moves should be generated."));
    46       Parameters.Add(new LookupParameter<TwoOptMove>("Move", "The moves that should be generated in subscopes."));
     46      Parameters.Add(new LookupParameter<TwoOptMove>("TwoOptMove", "The moves that should be generated in subscopes."));
    4747      Parameters.Add(new ScopeParameter("CurrentScope", "The current scope where the moves should be added as subscopes."));
    4848    }
     
    6161
    6262    protected abstract TwoOptMove[] GenerateMoves(Permutation permutation);
     63
     64    public override bool CanChangeName {
     65      get { return false; }
     66    }
    6367  }
    6468}
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/TwoOptMoveMaker.cs

    r3053 r3074  
    3333  public class TwoOptMoveMaker : SingleSuccessorOperator, ITwoOptPermutationMoveOperator, IMoveMaker {
    3434    public ILookupParameter<DoubleValue> QualityParameter {
    35       get { return (LookupParameter<DoubleValue>)Parameters["Quality"]; }
     35      get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; }
    3636    }
    3737    public ILookupParameter<DoubleValue> MoveQualityParameter {
    38       get { return (LookupParameter<DoubleValue>)Parameters["MoveQuality"]; }
     38      get { return (ILookupParameter<DoubleValue>)Parameters["MoveQuality"]; }
    3939    }
    4040    public ILookupParameter<TwoOptMove> TwoOptMoveParameter {
    41       get { return (LookupParameter<TwoOptMove>)Parameters["Move"]; }
     41      get { return (ILookupParameter<TwoOptMove>)Parameters["TwoOptMove"]; }
    4242    }
    4343    public ILookupParameter<Permutation> PermutationParameter {
     
    4848      : base() {
    4949      Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality of the solution."));
    50       Parameters.Add(new LookupParameter<TwoOptMove>("Move", "The move to evaluate."));
     50      Parameters.Add(new LookupParameter<TwoOptMove>("TwoOptMove", "The move to evaluate."));
    5151      Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The relative quality of the move."));
    5252      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The solution as permutation."));
     
    6464      return base.Apply();
    6565    }
     66
     67    public override bool CanChangeName {
     68      get { return false; }
     69    }
    6670  }
    6771}
Note: See TracChangeset for help on using the changeset viewer.