Free cookie consent management tool by TermsFeed Policy Generator

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

Renamed classes of HeuristicLab.Data (#909)

Location:
trunk/sources/HeuristicLab.Analysis/3.3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Analysis/3.3/BestAverageWorstQualityCalculator.cs

    r3017 r3048  
    3434  [Creatable("Test")]
    3535  public sealed class BestAverageWorstQualityCalculator : SingleSuccessorOperator {
    36     public IValueLookupParameter<BoolData> MaximizationParameter {
    37       get { return (IValueLookupParameter<BoolData>)Parameters["Maximization"]; }
     36    public IValueLookupParameter<BoolValue> MaximizationParameter {
     37      get { return (IValueLookupParameter<BoolValue>)Parameters["Maximization"]; }
    3838    }
    39     public ILookupParameter<ItemArray<DoubleData>> QualityParameter {
    40       get { return (ILookupParameter<ItemArray<DoubleData>>)Parameters["Quality"]; }
     39    public ILookupParameter<ItemArray<DoubleValue>> QualityParameter {
     40      get { return (ILookupParameter<ItemArray<DoubleValue>>)Parameters["Quality"]; }
    4141    }
    42     public IValueLookupParameter<DoubleData> BestQualityParameter {
    43       get { return (IValueLookupParameter<DoubleData>)Parameters["BestQuality"]; }
     42    public IValueLookupParameter<DoubleValue> BestQualityParameter {
     43      get { return (IValueLookupParameter<DoubleValue>)Parameters["BestQuality"]; }
    4444    }
    45     public IValueLookupParameter<DoubleData> AverageQualityParameter {
    46       get { return (IValueLookupParameter<DoubleData>)Parameters["AverageQuality"]; }
     45    public IValueLookupParameter<DoubleValue> AverageQualityParameter {
     46      get { return (IValueLookupParameter<DoubleValue>)Parameters["AverageQuality"]; }
    4747    }
    48     public IValueLookupParameter<DoubleData> WorstQualityParameter {
    49       get { return (IValueLookupParameter<DoubleData>)Parameters["WorstQuality"]; }
     48    public IValueLookupParameter<DoubleValue> WorstQualityParameter {
     49      get { return (IValueLookupParameter<DoubleValue>)Parameters["WorstQuality"]; }
    5050    }
    5151
    5252    public BestAverageWorstQualityCalculator()
    5353      : base() {
    54       Parameters.Add(new ValueLookupParameter<BoolData>("Maximization", "True if the current problem is a maximization problem, otherwise false."));
    55       Parameters.Add(new SubScopesLookupParameter<DoubleData>("Quality", "The value contained in each sub-scope which represents the solution quality."));
    56       Parameters.Add(new ValueLookupParameter<DoubleData>("BestQuality", "The quality value of the best solution."));
    57       Parameters.Add(new ValueLookupParameter<DoubleData>("AverageQuality", "The average quality of all solutions."));
    58       Parameters.Add(new ValueLookupParameter<DoubleData>("WorstQuality", "The quality value of the worst solution."));
     54      Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the current problem is a maximization problem, otherwise false."));
     55      Parameters.Add(new SubScopesLookupParameter<DoubleValue>("Quality", "The value contained in each sub-scope which represents the solution quality."));
     56      Parameters.Add(new ValueLookupParameter<DoubleValue>("BestQuality", "The quality value of the best solution."));
     57      Parameters.Add(new ValueLookupParameter<DoubleValue>("AverageQuality", "The average quality of all solutions."));
     58      Parameters.Add(new ValueLookupParameter<DoubleValue>("WorstQuality", "The quality value of the worst solution."));
    5959    }
    6060
    6161
    6262    public override IOperation Apply() {
    63       ItemArray<DoubleData> qualities = QualityParameter.ActualValue;
     63      ItemArray<DoubleValue> qualities = QualityParameter.ActualValue;
    6464      bool maximization = MaximizationParameter.ActualValue.Value;
    6565
     
    7777        }
    7878
    79         DoubleData best = BestQualityParameter.ActualValue;
    80         if (best == null) BestQualityParameter.ActualValue = new DoubleData(max);
     79        DoubleValue best = BestQualityParameter.ActualValue;
     80        if (best == null) BestQualityParameter.ActualValue = new DoubleValue(max);
    8181        else best.Value = max;
    82         DoubleData average = AverageQualityParameter.ActualValue;
    83         if (average == null) AverageQualityParameter.ActualValue = new DoubleData(sum / qualities.Length);
     82        DoubleValue average = AverageQualityParameter.ActualValue;
     83        if (average == null) AverageQualityParameter.ActualValue = new DoubleValue(sum / qualities.Length);
    8484        else average.Value = sum / qualities.Length;
    85         DoubleData worst = WorstQualityParameter.ActualValue;
    86         if (worst == null) WorstQualityParameter.ActualValue = new DoubleData(min);
     85        DoubleValue worst = WorstQualityParameter.ActualValue;
     86        if (worst == null) WorstQualityParameter.ActualValue = new DoubleValue(min);
    8787        else worst.Value = min;
    8888      }
  • trunk/sources/HeuristicLab.Analysis/3.3/BestQualityMemorizer.cs

    r3017 r3048  
    3333  [StorableClass]
    3434  public class BestQualityMemorizer : SingleSuccessorOperator {
    35     public IValueLookupParameter<BoolData> MaximizationParameter {
    36       get { return (IValueLookupParameter<BoolData>)Parameters["Maximization"]; }
     35    public IValueLookupParameter<BoolValue> MaximizationParameter {
     36      get { return (IValueLookupParameter<BoolValue>)Parameters["Maximization"]; }
    3737    }
    38     public ILookupParameter<ItemArray<DoubleData>> QualityParameter {
    39       get { return (ILookupParameter<ItemArray<DoubleData>>)Parameters["Quality"]; }
     38    public ILookupParameter<ItemArray<DoubleValue>> QualityParameter {
     39      get { return (ILookupParameter<ItemArray<DoubleValue>>)Parameters["Quality"]; }
    4040    }
    41     public IValueLookupParameter<DoubleData> BestQualityParameter {
    42       get { return (IValueLookupParameter<DoubleData>)Parameters["BestQuality"]; }
     41    public IValueLookupParameter<DoubleValue> BestQualityParameter {
     42      get { return (IValueLookupParameter<DoubleValue>)Parameters["BestQuality"]; }
    4343    }
    4444
    4545    public BestQualityMemorizer()
    4646      : base() {
    47       Parameters.Add(new ValueLookupParameter<BoolData>("Maximization", "True if the current problem is a maximization problem, otherwise false."));
    48       Parameters.Add(new SubScopesLookupParameter<DoubleData>("Quality", "The value contained in each sub-scope which represents the solution quality."));
    49       Parameters.Add(new ValueLookupParameter<DoubleData>("BestQuality", "The quality value of the best solution."));
     47      Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the current problem is a maximization problem, otherwise false."));
     48      Parameters.Add(new SubScopesLookupParameter<DoubleValue>("Quality", "The value contained in each sub-scope which represents the solution quality."));
     49      Parameters.Add(new ValueLookupParameter<DoubleValue>("BestQuality", "The quality value of the best solution."));
    5050    }
    5151
    5252    public override IOperation Apply() {
    53       ItemArray<DoubleData> qualities = QualityParameter.ActualValue;
     53      ItemArray<DoubleValue> qualities = QualityParameter.ActualValue;
    5454      bool maximization = MaximizationParameter.ActualValue.Value;
    55       DoubleData best = BestQualityParameter.ActualValue;
     55      DoubleValue best = BestQualityParameter.ActualValue;
    5656      double max = (best != null) ? (best.Value) : ((maximization) ? (double.MinValue) : (double.MaxValue));
    5757     
    58       foreach (DoubleData quality in qualities)
     58      foreach (DoubleValue quality in qualities)
    5959        if (IsBetter(maximization, quality.Value, max)) max = quality.Value;
    6060
    61       if (best == null) BestQualityParameter.ActualValue = new DoubleData(max);
     61      if (best == null) BestQualityParameter.ActualValue = new DoubleValue(max);
    6262      else best.Value = max;
    6363      return base.Apply();
  • trunk/sources/HeuristicLab.Analysis/3.3/DataTableValuesCollector.cs

    r3017 r3048  
    5252
    5353      foreach (IParameter param in CollectedValues) {
    54         DoubleData data = param.ActualValue as DoubleData;
     54        DoubleValue data = param.ActualValue as DoubleValue;
    5555        if (data == null) throw new InvalidOperationException("Only double data values can be collected by a DataTableValuesCollector.");
    5656
Note: See TracChangeset for help on using the changeset viewer.