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/Equal.cs

    r2 r155  
    3131    public override string Description {
    3232      get {
    33         return @"Equal condition. Returns 1.0 if both sub-functions evaluate to the same value and 0.0 if they differ.";
     33        return @"Equal condition. Returns 1.0 if both sub-trees evaluate to the same value and 0.0 if they differ.";
    3434      }
    3535    }
     
    4040    }
    4141
    42     public Equal(Equal source, IDictionary<Guid, object> clonedObjects)
    43       : base(source, clonedObjects) {
    44     }
    45 
    46 
    47     public override double Evaluate(Dataset dataset, int sampleIndex) {
    48       if(SubFunctions[0].Evaluate(dataset, sampleIndex) == SubFunctions[1].Evaluate(dataset, sampleIndex)) return 1.0;
     42    public override double Apply(Dataset dataset, int sampleIndex, double[] args) {
     43      if(args[0] == args[1]) return 1.0;
    4944      else return 0.0;
    50     }
    51 
    52     public override object Clone(IDictionary<Guid, object> clonedObjects) {
    53       Equal clone = new Equal(this, clonedObjects);
    54       clonedObjects.Add(clone.Guid, clone);
    55       return clone;
    5645    }
    5746
Note: See TracChangeset for help on using the changeset viewer.