Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/26/17 19:34:13 (7 years ago)
Author:
pkimmesw
Message:

#2665 Fixed analyzer, fixed Plush encoding + operators, adpated print evaluation according to McPhee

Location:
branches/PushGP/HeuristicLab.PushGP
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/PushGP/HeuristicLab.PushGP

    • Property svn:ignore set to
      *.user
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Generators/CodeGenerator/CodeGeneratorUtils.cs

    r15275 r15289  
    2828        ? customExpressions.Values.ElementAt(index - enabledExpressionCount)
    2929        : MapToExpression(index, random, ercOptions, config);
     30    }
     31
     32    internal static Expression MapToExpression(
     33      int index,
     34      IReadOnlyExpressionsConfiguration config) {
     35
     36      switch (index) {
     37        case PushSolutionEncoding.Noop:
     38          return Noop;
     39      }
     40
     41      var name = config.EnabledExpressions[index];
     42      return ExpressionTable.GetExpression(name);
    3043    }
    3144
     
    7689        instructions.InExpressionCount > 0) {
    7790
    78         var nr = random.Next(0, instructions.InExpressionCount) + 1;
    79         expression = ExpressionTable.InExpressionTable[nr];
     91        var index = random.Next(0, instructions.InExpressionCount);
     92        expression = ExpressionTable.InExpressionTable[index];
    8093      } else {
    8194        expression = GetRandomExpression(random, instructions);
Note: See TracChangeset for help on using the changeset viewer.