- Timestamp:
- 08/06/08 16:58:42 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Functions/BakedTreeEvaluator.cs
r424 r460 204 204 double x = EvaluateBakedCode(); 205 205 double y = EvaluateBakedCode(); 206 if(condition == 0.0) return x; 207 else return y; 206 return condition * y - (condition - 1) * x; 208 207 } 209 208 case EvaluatorSymbolTable.LT: { … … 216 215 double result = EvaluateBakedCode(); 217 216 Debug.Assert(result == 0.0 || result == 1.0); 218 if(result == 0.0) return 1.0; 219 else return 0.0; 217 return Math.Abs(result - 1.0); 220 218 } 221 219 case EvaluatorSymbolTable.OR: { // only defined for inputs 0 or 1 … … 224 222 double x = EvaluateBakedCode(); 225 223 Debug.Assert(x == 0.0 || x == 1.0); 226 if(x == 1.0) result = 1.0;227 } 228 return result;224 result += x; 225 } 226 return Math.Sign(result); 229 227 } 230 228 case EvaluatorSymbolTable.XOR: { // only defined for inputs 0 or 1
Note: See TracChangeset
for help on using the changeset viewer.