Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/22/08 18:05:14 (16 years ago)
Author:
gkronber
Message:

merged FunctionsAndStructIdRefactoring-branch (r142, r143, r144, r145, r146, r147, r148, r149, r152, r153) back into the trunk (ticket #112)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Functions/Not.cs

    r2 r155  
    3131    public override string Description {
    3232      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.";
    3434      }
    3535    }
     
    4040    }
    4141
    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]);
    4944      if(result == 0.0) return 1.0;
    5045      else if(result == 1.0) return 0.0;
    5146      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;
    5847    }
    5948
Note: See TracChangeset for help on using the changeset viewer.