Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/22/10 22:58:43 (14 years ago)
Author:
abeham
Message:

Added move operators for real encoding and test functions #890

Location:
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3
Files:
9 added
3 edited

Legend:

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

    r3182 r3187  
    103103    <Compile Include="Crossovers\UniformSomePositionsArithmeticCrossover.cs" />
    104104    <Compile Include="HeuristicLabEncodingsRealVectorEncodingPlugin.cs" />
     105    <Compile Include="Interfaces\IAdditiveRealVectorMoveOperator.cs" />
    105106    <Compile Include="Interfaces\IRealVectorBoundsChecker.cs" />
     107    <Compile Include="Interfaces\IRealVectorMoveGenerator.cs" />
     108    <Compile Include="Interfaces\IRealVectorMoveOperator.cs" />
     109    <Compile Include="Moves\Polynomial\StochasticPolynomialMultiMoveGenerator.cs" />
     110    <Compile Include="Moves\AdditiveMoveMaker.cs" />
     111    <Compile Include="Moves\AdditiveMove.cs" />
     112    <Compile Include="Moves\AdditiveMoveGenerator.cs" />
    106113    <Compile Include="RealVector.cs" />
    107114    <Compile Include="Manipulators\BreederGeneticAlgorithmManipulator.cs" />
  • trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/PolynomialAllPositionManipulator.cs

    r3060 r3187  
    4848    /// </summary>
    4949    /// <remarks>
    50     /// The manipulated value is not restricted by the (possibly) specified lower and upper bounds. Use the <see cref="BoundsChecker"/> to correct the values after performing the mutation.
     50    /// If there are bounds specified the manipulated value is restricted by the given lower and upper bounds.
    5151    /// </remarks>
    5252    public ValueLookupParameter<DoubleValue> MaximumManipulationParameter {
  • trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/PolynomialOnePositionManipulator.cs

    r3060 r3187  
    4747    /// </summary>
    4848    /// <remarks>
    49     /// The manipulated value is not restricted by the (possibly) specified lower and upper bounds. Use the <see cref="BoundsChecker"/> to correct the values after performing the mutation.
     49    /// If there are bounds specified the manipulated value is restricted by the given lower and upper bounds.
    5050    /// </remarks>
    5151    public ValueLookupParameter<DoubleValue> MaximumManipulationParameter {
     
    7373      if (contiguity.Value < 0) throw new ArgumentException("PolynomialOnePositionManipulator: Contiguity value is smaller than 0", "contiguity");
    7474      int index = random.Next(vector.Length);
     75      vector[index] += Apply(random, contiguity.Value) * maxManipulation.Value;
     76    }
     77
     78    public static double Apply(IRandom random, double contiguity) {
    7579      double u = random.NextDouble(), delta = 0;
    7680
    7781      if (u < 0.5) {
    78         delta = Math.Pow(2 * u, 1.0 / (contiguity.Value + 1)) - 1.0;
     82        delta = Math.Pow(2 * u, 1.0 / (contiguity + 1)) - 1.0;
    7983      } else if (u > 0.5) {
    80         delta = 1.0 - Math.Pow(2.0 - 2.0 * u, 1.0 / contiguity.Value + 1);
    81       } else if (u == 0.5) delta = 0;
     84        delta = 1.0 - Math.Pow(2.0 - 2.0 * u, 1.0 / contiguity + 1);
     85      } else delta = 0;
    8286
    83       vector[index] += delta * maxManipulation.Value;
     87      return delta;
    8488    }
    8589
Note: See TracChangeset for help on using the changeset viewer.