Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/26/10 00:04:24 (15 years ago)
Author:
abeham
Message:

updated permutation moves, fixed 3-opt #889

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

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/StochasticThreeOptMultiMoveGenerator.cs

    r3209 r3221  
    5353      ThreeOptMove[] moves = new ThreeOptMove[sampleSize];
    5454      for (int i = 0; i < sampleSize; i++) {
    55         int index1, index2, index3;
    56         index1 = random.Next(length - 1);
    57         do {
    58           index2 = random.Next(index1, length);
    59         } while (index2 - index1 >= length - 2);
    60         do {
    61           index3 = random.Next(length - index2 + index1 - 1);
    62         } while (index3 == index1);
    63        
    64         moves[i] = new ThreeOptMove(index1, index2, index3);
     55        moves[i] = StochasticThreeOptSingleMoveGenerator.Apply(permutation, random);
    6556      }
    6657      return moves;
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/ThreeOptMoveGenerator.cs

    r3074 r3221  
    3131  [StorableClass]
    3232  public abstract class ThreeOptMoveGenerator : SingleSuccessorOperator, IThreeOptPermutationMoveOperator, IMoveGenerator {
     33    public override bool CanChangeName {
     34      get { return false; }
     35    }
    3336    public ILookupParameter<Permutation> PermutationParameter {
    3437      get { return (ILookupParameter<Permutation>)Parameters["Permutation"]; }
    3538    }
    3639    public ILookupParameter<ThreeOptMove> ThreeOptMoveParameter {
    37       get { return (LookupParameter<ThreeOptMove>)Parameters["Move"]; }
     40      get { return (LookupParameter<ThreeOptMove>)Parameters["ThreeOptMove"]; }
    3841    }
    3942    protected ScopeParameter CurrentScopeParameter {
     
    4447      : base() {
    4548      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The permutation for which moves should be generated."));
    46       Parameters.Add(new LookupParameter<ThreeOptMove>("Move", "The moves that should be generated in subscopes."));
     49      Parameters.Add(new LookupParameter<ThreeOptMove>("ThreeOptMove", "The moves that should be generated in subscopes."));
    4750      Parameters.Add(new ScopeParameter("CurrentScope", "The current scope where the moves should be added as subscopes."));
    4851    }
     
    6164
    6265    protected abstract ThreeOptMove[] GenerateMoves(Permutation permutation);
    63 
    64     public override bool CanChangeName {
    65       get { return false; }
    66     }
    6766  }
    6867}
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/ThreeOptMoveMaker.cs

    r3200 r3221  
    3232  [StorableClass]
    3333  public class ThreeOptMoveMaker : SingleSuccessorOperator, IThreeOptPermutationMoveOperator, IMoveMaker {
     34    public override bool CanChangeName {
     35      get { return false; }
     36    }
    3437    public ILookupParameter<DoubleValue> QualityParameter {
    3538      get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; }
     
    6467      return base.Apply();
    6568    }
    66 
    67     public override bool CanChangeName {
    68       get { return false; }
    69     }
    7069  }
    7170}
Note: See TracChangeset for help on using the changeset viewer.