Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/28/08 09:16:33 (17 years ago)
Author:
gkronber
Message:

added a counter for the total number of evaluated nodes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.StructureIdentification/Evaluation/GPEvaluatorBase.cs

    r155 r200  
    3333  public abstract class GPEvaluatorBase : OperatorBase {
    3434    protected double maximumPunishment;
     35    protected int treeSize;
     36    protected double totalEvaluatedNodes;
    3537
    3638    public GPEvaluatorBase()
    3739      : base() {
    3840      AddVariableInfo(new VariableInfo("FunctionTree", "The function tree that should be evaluated", typeof(IFunctionTree), VariableKind.In));
     41      AddVariableInfo(new VariableInfo("TreeSize", "Size (number of nodes) of the tree to evaluate", typeof(IntData), VariableKind.In));
    3942      AddVariableInfo(new VariableInfo("Dataset", "Dataset with all samples on which to apply the function", typeof(Dataset), VariableKind.In));
    4043      AddVariableInfo(new VariableInfo("TargetVariable", "Index of the column of the dataset that holds the target variable", typeof(IntData), VariableKind.In));
    4144      AddVariableInfo(new VariableInfo("PunishmentFactor", "Punishment factor for invalid estimations", typeof(DoubleData), VariableKind.In));
     45      AddVariableInfo(new VariableInfo("TotalEvaluatedNodes", "Number of evaluated nodes", typeof(DoubleData), VariableKind.In | VariableKind.Out));
    4246      AddVariableInfo(new VariableInfo("Quality", "The evaluated quality of the model", typeof(DoubleData), VariableKind.New));
    4347    }
     
    4852      IFunctionTree functionTree = GetVariableValue<IFunctionTree>("FunctionTree", scope, true);
    4953      this.maximumPunishment = GetVariableValue<DoubleData>("PunishmentFactor", scope, true).Data * dataset.GetRange(targetVariable);
     54      this.treeSize = scope.GetVariableValue<IntData>("TreeSize", false).Data;
     55      this.totalEvaluatedNodes = scope.GetVariableValue<DoubleData>("TotalEvaluatedNodes", true).Data;
    5056
    5157      double result = Evaluate(scope, functionTree, targetVariable, dataset);
Note: See TracChangeset for help on using the changeset viewer.