Changeset 730 for trunk/sources/HeuristicLab.GP.Boolean/Evaluator.cs
- Timestamp:
- 11/10/08 18:42:44 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.GP.Boolean/Evaluator.cs
r720 r730 32 32 public Evaluator() 33 33 : base() { 34 AddVariableInfo(new VariableInfo("FunctionTree", "The function tree representing the ant", typeof( IFunctionTree), VariableKind.In));34 AddVariableInfo(new VariableInfo("FunctionTree", "The function tree representing the ant", typeof(BakedFunctionTree), VariableKind.In)); 35 35 AddVariableInfo(new VariableInfo("Dataset", "The boolean dataset (values 0.0 = false, 1.0=true)", typeof(Dataset), VariableKind.In)); 36 36 AddVariableInfo(new VariableInfo("TargetVariable", "Index of the column of the dataset that holds the target variable", typeof(IntData), VariableKind.In)); 37 37 AddVariableInfo(new VariableInfo("SamplesStart", "Start index of samples in dataset to evaluate", typeof(IntData), VariableKind.In)); 38 38 AddVariableInfo(new VariableInfo("SamplesEnd", "End index of samples in dataset to evaluate", typeof(IntData), VariableKind.In)); 39 AddVariableInfo(new VariableInfo(" MatchingCases", "", typeof(DoubleData), VariableKind.New | VariableKind.Out));39 AddVariableInfo(new VariableInfo("Errors", "", typeof(DoubleData), VariableKind.New | VariableKind.Out)); 40 40 } 41 41 42 42 public override IOperation Apply(IScope scope) { 43 IFunctionTree tree = GetVariableValue<IFunctionTree>("FunctionTree", scope, true);43 BakedFunctionTree tree = GetVariableValue<BakedFunctionTree>("FunctionTree", scope, true); 44 44 Dataset dataset = GetVariableValue<Dataset>("Dataset", scope, true); 45 45 int targetVariable = GetVariableValue<IntData>("TargetVariable", scope, true).Data; … … 49 49 BooleanTreeInterpreter interpreter = new BooleanTreeInterpreter(); 50 50 interpreter.Reset(dataset, tree, targetVariable); 51 int matchingCases = interpreter.GetNumberMatchingInstances(start, end);51 int errors = interpreter.GetNumberOfErrors(start, end); 52 52 53 scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName(" MatchingCases"), new DoubleData(matchingCases)));53 scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("Errors"), new DoubleData(errors))); 54 54 return null; 55 55 }
Note: See TracChangeset
for help on using the changeset viewer.