Esempio n. 1
0
        public ExpressionEvolverGeneticAlgorithmParameters(Func <double, double> target,
                                                           int count, double variance, SecureRandom random)
            : base()
        {
            target.CheckParameterForNull("target");
            random.CheckParameterForNull("random");

            this.Random = random;
            this.GenerateResults(target, count, variance);
        }
        public RandomExpressionGenerator(int maximumOperationCount, double injectConstantProbabilityValue,
                                         double constantLimit, ParameterExpression parameter, SecureRandom random)
            : base()
        {
            parameter.CheckParameterForNull("parameter");
            random.CheckParameterForNull("random");

            this.InjectConstantProbabilityValue = injectConstantProbabilityValue;
            this.ConstantLimit = constantLimit;
            this.Body          = parameter;
            this.Parameter     = parameter;
            this.Random        = random;
            this.GenerateBody(maximumOperationCount);
        }
Esempio n. 3
0
        public ExpressionEvolverGeneticAlgorithmParameters(ReadOnlyCollection <ExpressionEvolverResult> results,
                                                           SecureRandom random)
            : base()
        {
            results.CheckParameterForNull("results");
            random.CheckParameterForNull("random");

            if (results.Count < 1)
            {
                throw new ArgumentException("At least one result must be in the collection.", "results");
            }

            this.Results = results;
            this.Random  = random;
        }