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
Files:
9 added
3 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/HeuristicLab.Encodings.PermutationEncoding-3.3.csproj

    r3053 r3074  
    9898    <Compile Include="Interfaces\IPermutationMoveOperator.cs" />
    9999    <Compile Include="Interfaces\IPermutationOperator.cs" />
     100    <Compile Include="Interfaces\IThreeOptPermutationMoveOperator.cs" />
    100101    <Compile Include="Interfaces\ITwoOptPermutationMoveOperator.cs" />
    101102    <Compile Include="Manipulators\InsertionManipulator.cs" />
     
    106107    <Compile Include="Manipulators\TranslocationInversionManipulator.cs" />
    107108    <Compile Include="Manipulators\TranslocationManipulator.cs" />
     109    <Compile Include="Moves\ThreeIndexMove.cs" />
     110    <Compile Include="Moves\ThreeOpt\StochasticThreeOptMoveGenerator.cs" />
     111    <Compile Include="Moves\ThreeOpt\ThreeOptMove.cs" />
     112    <Compile Include="Moves\ThreeOpt\ThreeOptMoveGenerator.cs" />
    108113    <Compile Include="Moves\TwoOpt\ExhaustiveTwoOptMoveGenerator.cs">
    109114      <SubType>Code</SubType>
     
    120125      <SubType>Code</SubType>
    121126    </Compile>
    122     <Compile Include="Moves\TwoOpt\TwoOptMoveTabuAttribute.cs">
    123       <SubType>Code</SubType>
    124     </Compile>
    125     <Compile Include="Moves\TwoOpt\TwoOptMoveTabuEvaluator.cs">
    126       <SubType>Code</SubType>
    127     </Compile>
    128     <Compile Include="Moves\TwoOpt\TwoOptMoveTabuMaker.cs">
    129       <SubType>Code</SubType>
    130     </Compile>
     127    <Compile Include="Moves\TwoOpt\TwoOptTabuMoveAttribute.cs" />
     128    <Compile Include="Moves\TwoOpt\TwoOptTabuMoveEvaluator.cs" />
     129    <Compile Include="Moves\TwoOpt\TwoOptTabuMoveMaker.cs" />
    131130    <Compile Include="PermutationManipulator.cs" />
    132131    <Compile Include="PermutationCrossover.cs" />
  • 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.