Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/15/10 23:49:54 (14 years ago)
Author:
swagner
Message:

Renamed classes of HeuristicLab.Data (#909)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.RealVector/3.3/Crossovers/HeuristicCrossover.cs

    r3017 r3048  
    4040    /// Whether the problem is a maximization or minimization problem.
    4141    /// </summary>
    42     public ValueLookupParameter<BoolData> MaximizationParameter {
    43       get { return (ValueLookupParameter<BoolData>)Parameters["Maximization"]; }
     42    public ValueLookupParameter<BoolValue> MaximizationParameter {
     43      get { return (ValueLookupParameter<BoolValue>)Parameters["Maximization"]; }
    4444    }
    4545    /// <summary>
    4646    /// The quality of the parents.
    4747    /// </summary>
    48     public SubScopesLookupParameter<DoubleData> QualityParameter {
    49       get { return (SubScopesLookupParameter<DoubleData>)Parameters["Quality"]; }
     48    public SubScopesLookupParameter<DoubleValue> QualityParameter {
     49      get { return (SubScopesLookupParameter<DoubleValue>)Parameters["Quality"]; }
    5050    }
    5151
     
    5656    public HeuristicCrossover()
    5757      : base() {
    58       Parameters.Add(new ValueLookupParameter<BoolData>("Maximization", "Whether the problem is a maximization problem or not."));
    59       Parameters.Add(new SubScopesLookupParameter<DoubleData>("Quality", "The quality values of the parents."));
     58      Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "Whether the problem is a maximization problem or not."));
     59      Parameters.Add(new SubScopesLookupParameter<DoubleValue>("Quality", "The quality values of the parents."));
    6060    }
    6161
     
    6868    /// <param name="worseParent">The second parent for the crossover operation.</param>
    6969    /// <returns>The newly created real vector, resulting from the heuristic crossover.</returns>
    70     public static DoubleArrayData Apply(IRandom random, DoubleArrayData betterParent, DoubleArrayData worseParent) {
     70    public static DoubleArray Apply(IRandom random, DoubleArray betterParent, DoubleArray worseParent) {
    7171      if (betterParent.Length != worseParent.Length)
    7272        throw new ArgumentException("HeuristicCrossover: the two parents are not of the same length");
     
    7979        result[i] = betterParent[i] + factor * (betterParent[i] - worseParent[i]);
    8080      }
    81       return new DoubleArrayData(result);
     81      return new DoubleArray(result);
    8282    }
    8383
     
    9696    /// <param name="parents">An array containing the two real vectors that should be crossed.</param>
    9797    /// <returns>The newly created real vector, resulting from the crossover operation.</returns>
    98     protected override DoubleArrayData Cross(IRandom random, ItemArray<DoubleArrayData> parents) {
     98    protected override DoubleArray Cross(IRandom random, ItemArray<DoubleArray> parents) {
    9999      if (parents.Length != 2) throw new ArgumentException("HeuristicCrossover: The number of parents is not equal to 2");
    100100
     
    102102      if (QualityParameter.ActualValue == null || QualityParameter.ActualValue.Length != parents.Length) throw new InvalidOperationException("HeuristicCrossover: Parameter " + QualityParameter.ActualName + " could not be found, or not in the same quantity as there are parents.");
    103103
    104       ItemArray<DoubleData> qualities = QualityParameter.ActualValue;
     104      ItemArray<DoubleValue> qualities = QualityParameter.ActualValue;
    105105      bool maximization = MaximizationParameter.ActualValue.Value;
    106106
Note: See TracChangeset for help on using the changeset viewer.