Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/19/17 18:49:00 (8 years ago)
Author:
gkronber
Message:

#2704 added min value parameter for exp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.ExpressionGenerator/HeuristicLab.ExpressionGenerator/3.4/ExpressionGenerator.cs

    r14873 r14879  
    2323using System.Collections.Generic;
    2424using System.Linq;
    25 using System.Runtime.InteropServices;
    26 using HeuristicLab.Common;
    2725using HeuristicLab.Core;
    2826using HeuristicLab.Random;
     
    4846
    4947      var expTemplate = ExpOfScaledExpression(uniformRandom, Instantiate(prodTemplate, uniformRandom, 100, "prodOfVars"),
    50         valueRange: new UniformDistributedRandom(uniformRandom, 1, 4)); // TODO should also specify an offset
     48        minValue: new PointDistribution(-3),
     49        valueRange: new UniformDistributedRandom(uniformRandom, 4, 6));
    5150
    5251      var scaledExprTemplate = new ScalingTemplate(new UniformDistributedRandom(uniformRandom, 1, 10)) { Label = "*" };
     
    123122    /// template scales the argument expression first to guarantee reasonable values
    124123    private static ExpressionTemplate ExpOfScaledExpression(IRandom uniformRandom, IEnumerable<Expression> arguments,
     124      IRandom minValue = null,
    125125      IRandom valueRange = null) {
    126       var limitToRangeTemplate = new RangeTemplate(null, valueRange);
     126      var limitToRangeTemplate = new RangeTemplate(minValue, valueRange);
    127127      limitToRangeTemplate.AddArguments(arguments);
    128128
Note: See TracChangeset for help on using the changeset viewer.