Changeset 155 for trunk/sources/HeuristicLab.Functions/Not.cs
- Timestamp:
- 04/22/08 18:05:14 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Functions/Not.cs
r2 r155 31 31 public override string Description { 32 32 get { 33 return @"Logical NOT operation. Only defined for sub- operator-results 0.0 and 1.0.";33 return @"Logical NOT operation. Only defined for sub-tree-results 0.0 and 1.0."; 34 34 } 35 35 } … … 40 40 } 41 41 42 public Not(Not source, IDictionary<Guid, object> clonedObjects) 43 : base(source, clonedObjects) { 44 } 45 46 47 public override double Evaluate(Dataset dataset, int sampleIndex) { 48 double result = Math.Round(SubFunctions[0].Evaluate(dataset, sampleIndex)); 42 public override double Apply(Dataset dataset, int sampleIndex, double[] args) { 43 double result = Math.Round(args[0]); 49 44 if(result == 0.0) return 1.0; 50 45 else if(result == 1.0) return 0.0; 51 46 else return double.NaN; 52 }53 54 public override object Clone(IDictionary<Guid, object> clonedObjects) {55 Not clone = new Not(this, clonedObjects);56 clonedObjects.Add(clone.Guid, clone);57 return clone;58 47 } 59 48
Note: See TracChangeset
for help on using the changeset viewer.