Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/20/12 10:34:59 (12 years ago)
Author:
mkommend
Message:

#1900: Corrected calculation of extension point lengths in the PTC2 to avoid overflow exceptions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/ProbabilisticTreeCreator.cs

    r7259 r8311  
    176176        extensionPoints.Add(x);
    177177      }
    178       long minExtensionPointsLength = extensionPoints.Select(x => x.MinimumExtensionLength).Sum();
    179       long maxExtensionPointsLength = extensionPoints.Select(x => x.MaximumExtensionLength).Sum();
     178      //necessary to use long data type as the extension point length could be int.MaxValue
     179      long minExtensionPointsLength = extensionPoints.Select(x => (long)x.MinimumExtensionLength).Sum();
     180      long maxExtensionPointsLength = extensionPoints.Select(x => (long)x.MaximumExtensionLength).Sum();
    180181
    181182      // while there are pending extension points and we have not reached the limit of adding new extension points
Note: See TracChangeset for help on using the changeset viewer.