Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/18/10 10:56:50 (15 years ago)
Author:
gkronber
Message:

Fixed a bug in the network transformation operator and changed test-cases to detect the problem. #833

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.GP.StructureIdentification.Networks/3.2/NetworkToFunctionTransformer.cs

    r2633 r2635  
    5151
    5252      var targetVariableEnumerator = targetVariables.Select(x => x.Data).GetEnumerator();
     53      List<IFunctionTree> transformedTrees = new List<IFunctionTree>(Transform(model.FunctionTree, targetVariables.Select(x => x.Data)));
    5354      // create a new sub-scope for each target variable with the transformed expression
    54       foreach (IFunctionTree transformedTree in Transform(model.FunctionTree, targetVariables.Select(x => x.Data))) {
     55      foreach (IFunctionTree transformedTree in transformedTrees) {
    5556        targetVariableEnumerator.MoveNext();
    5657        Scope exprScope = new Scope();
     
    7273      // create a new sub-scope for each target variable with the transformed expression
    7374      foreach (var targetVariable in targetVariables) {
    74         yield return TransformExpression(boundExpression, targetVariable, targetVariables.Except(new string[] { targetVariable }));
     75        yield return TransformExpression((IFunctionTree)boundExpression.Clone(), targetVariable, targetVariables.Except(new string[] { targetVariable }));
    7576      }
    7677    }
Note: See TracChangeset for help on using the changeset viewer.