/// <summary>
        ///     Construct the ramped half-and-half generator.
        /// </summary>
        /// <param name="theContext">The context.</param>
        /// <param name="theMinDepth">The minimum depth.</param>
        /// <param name="theMaxDepth">The maximum depth.</param>
        public RampedHalfAndHalf(EncogProgramContext theContext,
                                 int theMinDepth, int theMaxDepth)
            : base(theContext, theMaxDepth)
        {
            _minDepth = theMinDepth;

            _fullGenerator = new PrgFullGenerator(theContext, theMaxDepth);
            _growGenerator = new PrgGrowGenerator(theContext, theMaxDepth);
        }
Пример #2
0
        /// <summary>
        ///     Construct the ramped half-and-half generator.
        /// </summary>
        /// <param name="theContext">The context.</param>
        /// <param name="theMinDepth">The minimum depth.</param>
        /// <param name="theMaxDepth">The maximum depth.</param>
        public RampedHalfAndHalf(EncogProgramContext theContext,
                                 int theMinDepth, int theMaxDepth)
            : base(theContext, theMaxDepth)
        {
            _minDepth = theMinDepth;

            _fullGenerator = new PrgFullGenerator(theContext, theMaxDepth);
            _growGenerator = new PrgGrowGenerator(theContext, theMaxDepth);
        }
Пример #3
0
        public void TestDepth()
        {
            EncogProgramContext context = new EncogProgramContext();
            context.DefineVariable("x");

            StandardExtensions.CreateAll(context);

            PrgGrowGenerator rnd = new PrgGrowGenerator(context, 2);
            EncogProgram prg = (EncogProgram)rnd.Generate(new EncogRandom());
            RenderCommonExpression render = new RenderCommonExpression();
        }
 /// <summary>
 ///     Construct the subtree mutation object.
 /// </summary>
 /// <param name="theContext">The program context.</param>
 /// <param name="theMaxDepth">The maximum depth.</param>
 public SubtreeMutation(EncogProgramContext theContext,
                        int theMaxDepth)
 {
     Generator = new PrgGrowGenerator(theContext, theMaxDepth);
     _maxDepth = theMaxDepth;
 }