Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/15/17 08:44:15 (7 years ago)
Author:
gkronber
Message:

#2704: added possibility to automatically adjust constants based on the distributions of evaluated expressions to allow limiting distributions for arguments of functions (e.g. log should have positive args only, exp should have rather small args only)

File:
1 edited

Legend:

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

    r14520 r14873  
    4242    }
    4343
    44     public IRandom Distribution { get; private set; }
    45 
    46     public Func<IEnumerable<double>, double> Transform { get; private set; }
    47 
    48     public double Value { get; private set; }
     44    public IRandom Distribution { get; private set; }  // only for random variables
     45
     46    public Func<IEnumerable<double>, double> Transform { get; private set; } // only for functions
     47
     48    public double Value { get; private set; } // only for constants
    4949
    5050    public Expression(string name, double value) {
     
    8585      switch (Type) {
    8686        case ExpressionType.Constant:
    87           sb.Append(Value.ToString("0.000", CultureInfo.CurrentCulture));
     87          sb.Append(Value.ToString("0.000", CultureInfo.InvariantCulture));
    8888          break;
    8989        case ExpressionType.RandomVariable:
     
    108108        case ExpressionType.Constant:
    109109          sb.Append(Value < 0
    110               ? string.Format("(- {0})", Math.Abs(Value).ToString("0.000", CultureInfo.CurrentCulture))
    111               : Value.ToString("0.000", CultureInfo.CurrentCulture));
     110              ? string.Format("(- {0})", Math.Abs(Value).ToString("0.000", CultureInfo.InvariantCulture))
     111              : Value.ToString("0.000", CultureInfo.InvariantCulture));
    112112          break;
    113113        case ExpressionType.RandomVariable:
Note: See TracChangeset for help on using the changeset viewer.