Free cookie consent management tool by TermsFeed Policy Generator

Changeset 1916


Ignore:
Timestamp:
05/27/09 17:04:48 (15 years ago)
Author:
mkommend
Message:

corrected bug with total evaluated nodes; skipped samples were also counted (ticket #515)

Location:
trunk/sources/HeuristicLab.GP.StructureIdentification.ConditionalEvaluation/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.GP.StructureIdentification.ConditionalEvaluation/3.3/ConditionalEvaluatorBase.cs

    r1915 r1916  
    4545      int conditionVariable = GetVariableValue<IntData>("ConditionVariable", scope, true).Data;
    4646
     47      int skippedSampels = 0;
    4748      // store original and estimated values in a double array
    4849      double[,] values = new double[end - start, 2];
     
    5152        bool skip = false;
    5253        for (int checkIndex = sample + minTimeOffset; checkIndex <= sample + maxTimeOffset && !skip ; checkIndex++) {
    53           if (dataset.GetValue(checkIndex, conditionVariable) == 0)
     54          if (dataset.GetValue(checkIndex, conditionVariable) == 0) {
    5455            skip = true;
     56            skippedSampels++;
     57          }
    5558        }
    5659        if (!skip) {
     
    6568      }
    6669
     70
    6771      // calculate quality value
    6872      double quality = Evaluate(values);
     
    7478      }
    7579      qualityData.Data = quality;
     80      scope.GetVariableValue<DoubleData>("TotalEvaluatedNodes", true).Data -= skippedSampels;
    7681    }
    7782
  • trunk/sources/HeuristicLab.GP.StructureIdentification.ConditionalEvaluation/3.3/ConditionalSimpleEvaluator.cs

    r1915 r1916  
    5353      int minTimeOffset = GetVariableValue<IntData>("MinTimeOffset", scope, true).Data;
    5454      int conditionVariable = GetVariableValue<IntData>("ConditionVariable", scope, true).Data;
     55      int skippedSampels = 0;
    5556
    5657      for (int sample = start; sample < end; sample++) {
     
    5859        bool skip = false;
    5960        for (int checkIndex = sample + minTimeOffset; checkIndex <= sample + maxTimeOffset && !skip ; checkIndex++) {
    60           if (dataset.GetValue(checkIndex, conditionVariable) == 0)
     61          if (dataset.GetValue(checkIndex, conditionVariable) == 0) {
    6162            skip = true;
     63            skippedSampels++;
     64          }
    6265        }
    6366        if (!skip) {
     
    7376        }
    7477      }
     78      scope.GetVariableValue<DoubleData>("TotalEvaluatedNodes", true).Data -= skippedSampels;
    7579    }
    7680  }
Note: See TracChangeset for help on using the changeset viewer.