- Timestamp:
- 04/28/08 09:16:33 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.StructureIdentification/Evaluation/GPEvaluatorBase.cs
r155 r200 33 33 public abstract class GPEvaluatorBase : OperatorBase { 34 34 protected double maximumPunishment; 35 protected int treeSize; 36 protected double totalEvaluatedNodes; 35 37 36 38 public GPEvaluatorBase() 37 39 : base() { 38 40 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)); 39 42 AddVariableInfo(new VariableInfo("Dataset", "Dataset with all samples on which to apply the function", typeof(Dataset), VariableKind.In)); 40 43 AddVariableInfo(new VariableInfo("TargetVariable", "Index of the column of the dataset that holds the target variable", typeof(IntData), VariableKind.In)); 41 44 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)); 42 46 AddVariableInfo(new VariableInfo("Quality", "The evaluated quality of the model", typeof(DoubleData), VariableKind.New)); 43 47 } … … 48 52 IFunctionTree functionTree = GetVariableValue<IFunctionTree>("FunctionTree", scope, true); 49 53 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; 50 56 51 57 double result = Evaluate(scope, functionTree, targetVariable, dataset);
Note: See TracChangeset
for help on using the changeset viewer.