Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/27/10 17:31:09 (13 years ago)
Author:
gkronber
Message:

Fixed #1214. The size of the manipulated tree is checked and only if the new tree fulfills the size requirements it is accepted otherwise the original tree is returned instead. Additionally the calculation of tree sizes is checked for overflows now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/ArgumentDuplicater.cs

    r4477 r4524  
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2727using System.Collections.Generic;
     28using System;
    2829
    2930namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators {
     
    8788        List<SymbolicExpressionTreeNode> newlyAddedBranches = new List<SymbolicExpressionTreeNode>();
    8889        foreach (var invokeNode in invocationNodes) {
     90          // check that the invocation node really has the correct number of arguments
     91          if (invokeNode.SubTrees.Count != selectedDefunBranch.NumberOfArguments) throw new InvalidOperationException();
    8992          var argumentBranch = invokeNode.SubTrees[selectedArgumentSymbol.ArgumentIndex];
    9093          var clonedArgumentBranch = (SymbolicExpressionTreeNode)argumentBranch.Clone();
Note: See TracChangeset for help on using the changeset viewer.