Changeset 10788 for trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs
- Timestamp:
- 04/24/14 09:23:18 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs
r10774 r10788 345 345 } 346 346 case OpCodes.XOR: { 347 double firstArgument = Evaluate(dataset, ref row, state); 348 double result = 1.0; 349 for (int i = 1; i < currentInstr.nArguments; i++) { 350 if (result <= 0.0) { 351 state.SkipInstructions(); 352 } else { 353 double evalutationResult = Evaluate(dataset, ref row, state); 354 if (firstArgument <= 0 && evalutationResult > 0) result = -1.0; 355 else if (firstArgument > 0 && evalutationResult <= 0) result = -1.0; 356 } 357 } 358 return result > 0.0 ? 1.0 : -1.0; 347 //mkommend: XOR on multiple inputs is defined as true if the number of positive signals is odd 348 // this is equal to a consecutive execution of binary XOR operations. 349 int positiveSignals = 0; 350 for (int i = 0; i < currentInstr.nArguments; i++) { 351 if (Evaluate(dataset, ref row, state) > 0.0) positiveSignals++; 352 } 353 return positiveSignals % 2 != 0 ? 1.0 : -1.0; 359 354 } 360 355 case OpCodes.GT: {
Note: See TracChangeset
for help on using the changeset viewer.