Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/10/15 11:29:34 (9 years ago)
Author:
mkommend
Message:

#2320: Merged the encoding class and all accompanying changes in the trunk.

Location:
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding

  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers/SubtreeCrossover.cs

    r12012 r12422  
    2828using HeuristicLab.Parameters;
    2929using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     30using HeuristicLab.Random;
    3031
    3132namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
     
    181182                                   select branch).ToList();
    182183        if (allowedInternalBranches.Count > 0) {
    183           return allowedInternalBranches.SelectRandom(random);
     184          return allowedInternalBranches.SampleRandom(random);
     185
    184186        } else {
    185187          // no internal nodes allowed => select leaf nodes
     
    187189                                 where branch == null || branch.SubtreeCount == 0
    188190                                 select branch).ToList();
    189           return allowedLeafBranches.SelectRandom(random);
     191          return allowedLeafBranches.SampleRandom(random);
    190192        }
    191193      } else {
     
    195197                               select branch).ToList();
    196198        if (allowedLeafBranches.Count > 0) {
    197           return allowedLeafBranches.SelectRandom(random);
     199          return allowedLeafBranches.SampleRandom(random);
    198200        } else {
    199201          allowedInternalBranches = (from branch in branches
    200202                                     where branch != null && branch.SubtreeCount > 0
    201203                                     select branch).ToList();
    202           return allowedInternalBranches.SelectRandom(random);
     204          return allowedInternalBranches.SampleRandom(random);
     205
    203206        }
    204207      }
Note: See TracChangeset for help on using the changeset viewer.