Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/29/10 18:49:55 (14 years ago)
Author:
abeham
Message:

Renamed operators according to the underlying operation #889

File:
1 moved

Legend:

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

    r3229 r3232  
    2828
    2929namespace HeuristicLab.Encodings.PermutationEncoding {
    30   [Item("StochasticTwoOptSingleMoveGenerator", "Randomly samples a single from all possible 2-opt moves (inversion) from a given permutation.")]
     30  [Item("StochasticInversionSingleMoveGenerator", "Randomly samples a single from all possible inversion moves (2-opt) from a given permutation.")]
    3131  [StorableClass]
    32   public class StochasticTwoOptSingleMoveGenerator : TwoOptMoveGenerator, IStochasticOperator, ISingleMoveGenerator {
     32  public class StochasticInversionSingleMoveGenerator : InversionMoveGenerator, IStochasticOperator, ISingleMoveGenerator {
    3333    public ILookupParameter<IRandom> RandomParameter {
    3434      get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
    3535    }
    3636
    37     public StochasticTwoOptSingleMoveGenerator()
     37    public StochasticInversionSingleMoveGenerator()
    3838      : base() {
    3939      Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator."));
    4040    }
    4141
    42     public static TwoOptMove Apply(Permutation permutation, IRandom random) {
     42    public static InversionMove Apply(Permutation permutation, IRandom random) {
    4343      int length = permutation.Length;
    4444      int index1 = random.Next(length - 1);
    4545      int index2 = random.Next(index1 + 1, length);
    46       return new TwoOptMove(index1, index2);;
     46      return new InversionMove(index1, index2);;
    4747    }
    4848
    49     protected override TwoOptMove[] GenerateMoves(Permutation permutation) {
     49    protected override InversionMove[] GenerateMoves(Permutation permutation) {
    5050      IRandom random = RandomParameter.ActualValue;
    51       return new TwoOptMove[] { Apply(permutation, random) };
     51      return new InversionMove[] { Apply(permutation, random) };
    5252    }
    5353  }
Note: See TracChangeset for help on using the changeset viewer.