Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/16/10 10:46:59 (15 years ago)
Author:
svonolfe
Message:

Updated the RealVector project to use the new solution encodings (#909)

Location:
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/BreederGeneticAlgorithmManipulator.cs

    r3053 r3060  
    6666    /// <param name="max">The maximum number of the sampling range for the vector element (exclusive).</param>
    6767    /// <param name="searchIntervalFactor">The factor determining the size of the search interval.</param>
    68     public static void Apply(IRandom random, DoubleArray vector, DoubleValue min, DoubleValue max, DoubleValue searchIntervalFactor) {
     68    public static void Apply(IRandom random, RealVector vector, DoubleValue min, DoubleValue max, DoubleValue searchIntervalFactor) {
    6969      int length = vector.Length;
    7070      double prob, value;
     
    114114
    115115    /// <summary>
    116     /// Checks the parameters Minimum, Maximum, and SearchIntervalFactor and forwards the call to <see cref="Apply(IRandom, DoubleArray, DoubleValue, DoubleValue, DoubleValue)"/>.
     116    /// Checks the parameters Minimum, Maximum, and SearchIntervalFactor and forwards the call to <see cref="Apply(IRandom, RealVector, DoubleValue, DoubleValue, DoubleValue)"/>.
    117117    /// </summary>
    118118    /// <param name="random">A random number generator.</param>
    119119    /// <param name="realVector">The real vector to manipulate.</param>
    120     protected override void Manipulate(IRandom random, DoubleArray realVector) {
     120    protected override void Manipulate(IRandom random, RealVector realVector) {
    121121      if (MinimumParameter.ActualValue == null) throw new InvalidOperationException("BreederGeneticAlgorithmManipulator: Parameter " + MinimumParameter.ActualName + " could not be found.");
    122122      if (MaximumParameter.ActualValue == null) throw new InvalidOperationException("BreederGeneticAlgorithmManipulator: Paraemter " + MaximumParameter.ActualName + " could not be found.");
  • trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/MichalewiczNonUniformAllPositionsManipulator.cs

    r3053 r3060  
    9595    /// <param name="generationsDependency">Specifies the degree of dependency on the number of generations.</param>
    9696    /// <returns>The manipulated real vector.</returns>
    97     public static void Apply(IRandom random, DoubleArray vector, DoubleValue min, DoubleValue max, IntValue currentGeneration, IntValue maximumGenerations, DoubleValue generationsDependency) {
     97    public static void Apply(IRandom random, RealVector vector, DoubleValue min, DoubleValue max, IntValue currentGeneration, IntValue maximumGenerations, DoubleValue generationsDependency) {
    9898      if (currentGeneration.Value > maximumGenerations.Value) throw new ArgumentException("MichalewiczNonUniformAllPositionManipulator: CurrentGeneration must be smaller or equal than MaximumGeneration", "currentGeneration");
    9999      int length = vector.Length;
     
    111111
    112112    /// <summary>
    113     /// Checks if all parameters are available and forwards the call to <see cref="Apply(IRandom, DoubleArray, DoubleValue, DoubleValue, IntValue, IntValue, DoubleValue)"/>.
     113    /// Checks if all parameters are available and forwards the call to <see cref="Apply(IRandom, RealVector, DoubleValue, DoubleValue, IntValue, IntValue, DoubleValue)"/>.
    114114    /// </summary>
    115115    /// <param name="random">The random number generator.</param>
    116116    /// <param name="realVector">The real vector that should be manipulated.</param>
    117     protected override void Manipulate(IRandom random, DoubleArray realVector) {
     117    protected override void Manipulate(IRandom random, RealVector realVector) {
    118118      if (MinimumParameter.ActualValue == null) throw new InvalidOperationException("MichalewiczNonUniformAllPositionManipulator: Parameter " + MinimumParameter.ActualName + " could not be found.");
    119119      if (MaximumParameter.ActualValue == null) throw new InvalidOperationException("MichalewiczNonUniformAllPositionManipulator: Parameter " + MaximumParameter.ActualName + " could not be found.");
  • trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/MichalewiczNonUniformOnePositionManipulator.cs

    r3053 r3060  
    9595    /// <param name="generationsDependency">Specifies the degree of dependency on the number of generations.</param>
    9696    /// <returns>The manipulated real vector.</returns>
    97     public static void Apply(IRandom random, DoubleArray vector, DoubleValue min, DoubleValue max, IntValue currentGeneration, IntValue maximumGenerations, DoubleValue generationsDependency) {
     97    public static void Apply(IRandom random, RealVector vector, DoubleValue min, DoubleValue max, IntValue currentGeneration, IntValue maximumGenerations, DoubleValue generationsDependency) {
    9898      if (currentGeneration.Value > maximumGenerations.Value) throw new ArgumentException("MichalewiczNonUniformOnePositionManipulator: CurrentGeneration must be smaller or equal than MaximumGeneration", "currentGeneration");
    9999      int length = vector.Length;
     
    110110
    111111    /// <summary>
    112     /// Checks if all parameters are available and forwards the call to <see cref="Apply(IRandom, DoubleArray, DoubleValue, DoubleValue, IntValue, IntValue, DoubleValue)"/>.
     112    /// Checks if all parameters are available and forwards the call to <see cref="Apply(IRandom, RealVector, DoubleValue, DoubleValue, IntValue, IntValue, DoubleValue)"/>.
    113113    /// </summary>
    114114    /// <param name="random">The random number generator.</param>
    115115    /// <param name="realVector">The real vector that should be manipulated.</param>
    116     protected override void Manipulate(IRandom random, DoubleArray realVector) {
     116    protected override void Manipulate(IRandom random, RealVector realVector) {
    117117      if (MinimumParameter.ActualValue == null) throw new InvalidOperationException("MichalewiczNonUniformOnePositionManipulator: Parameter " + MinimumParameter.ActualName + " could not be found.");
    118118      if (MaximumParameter.ActualValue == null) throw new InvalidOperationException("MichalewiczNonUniformOnePositionManipulator: Parameter " + MaximumParameter.ActualName + " could not be found.");
  • trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/PolynomialAllPositionManipulator.cs

    r3053 r3060  
    7171    /// <param name="contiguity">A parameter describing the shape of the probability density function which influences the strength of the manipulation.</param>
    7272    /// <param name="maxManipulation">The maximum strength of the manipulation.</param>
    73     public static void Apply(IRandom random, DoubleArray vector, DoubleValue contiguity, DoubleValue maxManipulation) {
     73    public static void Apply(IRandom random, RealVector vector, DoubleValue contiguity, DoubleValue maxManipulation) {
    7474      if (contiguity.Value < 0) throw new ArgumentException("PolynomialAllPositionManipulator: Contiguity value is smaller than 0", "contiguity");
    7575      double u, delta = 0;
     
    8888
    8989    /// <summary>
    90     /// Checks the availability of the parameters and forwards the call to <see cref="Apply(IRandom, DoubleArray, DoubleValue, DoubleValue)"/>.
     90    /// Checks the availability of the parameters and forwards the call to <see cref="Apply(IRandom, RealVector, DoubleValue, DoubleValue)"/>.
    9191    /// </summary>
    9292    /// <param name="random">The random number generator to use.</param>
    9393    /// <param name="realVector">The vector of real values to manipulate.</param>
    94     protected override void Manipulate(IRandom random, DoubleArray realVector) {
     94    protected override void Manipulate(IRandom random, RealVector realVector) {
    9595      if (ContiguityParameter.ActualValue == null) throw new InvalidOperationException("PolynomialAllPositionManipulator: Parameter " + ContiguityParameter.ActualName + " could not be found.");
    9696      if (MaximumManipulationParameter.ActualValue == null) throw new InvalidOperationException("PolynomialAllPositionManipulator: Parameter " + MaximumManipulationParameter.ActualName + " could not be found.");
  • trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/PolynomialOnePositionManipulator.cs

    r3053 r3060  
    7070    /// <param name="contiguity">A parameter describing the shape of the probability density function which influences the strength of the manipulation.</param>
    7171    /// <param name="maxManipulation">The maximum strength of the manipulation.</param>
    72     public static void Apply(IRandom random, DoubleArray vector, DoubleValue contiguity, DoubleValue maxManipulation) {
     72    public static void Apply(IRandom random, RealVector vector, DoubleValue contiguity, DoubleValue maxManipulation) {
    7373      if (contiguity.Value < 0) throw new ArgumentException("PolynomialOnePositionManipulator: Contiguity value is smaller than 0", "contiguity");
    7474      int index = random.Next(vector.Length);
     
    8585
    8686    /// <summary>
    87     /// Checks the availability of the parameters and forwards the call to <see cref="Apply(IRandom, DoubleArray, DoubleValue, DoubleValue)"/>.
     87    /// Checks the availability of the parameters and forwards the call to <see cref="Apply(IRandom, RealVector, DoubleValue, DoubleValue)"/>.
    8888    /// </summary>
    8989    /// <param name="random">The random number generator to use.</param>
    9090    /// <param name="realVector">The vector of real values to manipulate.</param>
    91     protected override void Manipulate(IRandom random, DoubleArray realVector) {
     91    protected override void Manipulate(IRandom random, RealVector realVector) {
    9292      if (ContiguityParameter.ActualValue == null) throw new InvalidOperationException("PolynomialOnePositionManipulator: Parameter " + ContiguityParameter.ActualName + " could not be found.");
    9393      if (MaximumManipulationParameter.ActualValue == null) throw new InvalidOperationException("PolynomialOnePositionManipulator: Parameter " + MaximumManipulationParameter.ActualName + " could not be found.");
  • trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/SelfAdaptiveNormalAllPositionsManipulator.cs

    r3053 r3060  
    4242    /// Parameter for the strategy vector.
    4343    /// </summary>
    44     public LookupParameter<DoubleArray> StrategyVectorParameter {
    45       get { return (LookupParameter<DoubleArray>)Parameters["StrategyVector"]; }
     44    public LookupParameter<RealVector> StrategyVectorParameter {
     45      get { return (LookupParameter<RealVector>)Parameters["StrategyVector"]; }
    4646    }
    4747    /// <summary>
     
    5151    public SelfAdaptiveNormalAllPositionsManipulator()
    5252      : base() {
    53       Parameters.Add(new LookupParameter<DoubleArray>("StrategyVector", "The vector containing the endogenous strategy parameters."));
     53      Parameters.Add(new LookupParameter<RealVector>("StrategyVector", "The vector containing the endogenous strategy parameters."));
    5454    }
    5555
     
    6464    /// <param name="vector">The real vector to manipulate.</param>
    6565    /// <returns>The manipulated real vector.</returns>
    66     public static void Apply(IRandom random, DoubleArray vector, DoubleArray strategyParameters) {
     66    public static void Apply(IRandom random, RealVector vector, RealVector strategyParameters) {
    6767      NormalDistributedRandom N = new NormalDistributedRandom(random, 0.0, 1.0);
    6868      for (int i = 0; i < vector.Length; i++) {
     
    7272
    7373    /// <summary>
    74     /// Checks that the strategy vector is not null and forwards the call to <see cref="Apply(IRandom, DoubleArray, DoubleArray)"/>.
     74    /// Checks that the strategy vector is not null and forwards the call to <see cref="Apply(IRandom, RealVector, RealVector)"/>.
    7575    /// </summary>
    7676    /// <param name="random">The random number generator.</param>
    7777    /// <param name="realVector">The vector of real values that is manipulated.</param>
    78     protected override void Manipulate(IRandom random, DoubleArray realVector) {
     78    protected override void Manipulate(IRandom random, RealVector realVector) {
    7979      if (StrategyVectorParameter.ActualValue == null) throw new InvalidOperationException("SelfAdaptiveNormalAllPositionsManipulator: Parameter " + StrategyVectorParameter.ActualName + " could not be found.");
    8080      Apply(random, realVector, StrategyVectorParameter.ActualValue);
  • trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/UniformOnePositionManipulator.cs

    r3053 r3060  
    6767    /// <param name="max">The maximum value of the sampling range for
    6868    /// the vector element to change (exclusive).</param>
    69     public static void Apply(IRandom random, DoubleArray vector, DoubleValue min, DoubleValue max) {
     69    public static void Apply(IRandom random, RealVector vector, DoubleValue min, DoubleValue max) {
    7070      int index = random.Next(vector.Length);
    7171      vector[index] = min.Value + random.NextDouble() * (max.Value - min.Value);
     
    7373
    7474    /// <summary>
    75     /// Checks if the minimum and maximum parameters are available and forwards the call to <see cref="Apply(IRandom, DoubleArray, DoubleValue, DoubleValue)"/>.
     75    /// Checks if the minimum and maximum parameters are available and forwards the call to <see cref="Apply(IRandom, RealVector, DoubleValue, DoubleValue)"/>.
    7676    /// </summary>
    7777    /// <param name="random">The random number generator to use.</param>
    7878    /// <param name="realVector">The real vector to manipulate.</param>
    79     protected override void Manipulate(IRandom random, DoubleArray realVector) {
     79    protected override void Manipulate(IRandom random, RealVector realVector) {
    8080      if (MinimumParameter.ActualValue == null) throw new InvalidOperationException("UniformOnePositionManipulator: Parameter " + MinimumParameter.ActualName + " could not be found.");
    8181      if (MaximumParameter.ActualValue == null) throw new InvalidOperationException("UniformOnePositionManipulator: Parameter " + MaximumParameter.ActualName + " could not be found.");
Note: See TracChangeset for help on using the changeset viewer.