public RandomMutationSearch(TrainingSamplesGenerator generator, int mutationsInEachStep, NodeTypeFrequencyProfile profile)
     : base(generator)
 {
     this.mutationsInStep = mutationsInEachStep;
     this.profile         = profile;
     this.mutator         = new PointMutation(profile, 3);
     this.mutatedPrograms = new List <EvaluatedEntity <SolutionProgram> >();
 }
Esempio n. 2
0
        /// <summary>
        /// To test the primality testing program and Erratic sequence program
        /// </summary>
        /// <param name="args"></param>
        static void Main4(string[] args)
        {
            runEvaluation(new PrimalityTestingSamplesGenerator(), getProgram2(), 10000, quiet: true);
            new GraphVisualizer().visualizeDialog(ProgramTreeDrawer.createGraph(getProgram2()));

            //applies a random mutation to the program and evaluates it. Repeates 10-times.
            NodeTypeRelativizedFrequencyProfile prof = NodeTypeRelativizedFrequencyProfile.createProfile(new List <SolutionProgram> {
                getProgram0(), getProgram1(), getProgram2()
            });
            PointMutation m = new PointMutation(prof, 1);

            for (int i = 0; i < 10; i++)
            {
                var p = getProgram2();
                m.modify(p);
                new GraphVisualizer().visualizeDialog(ProgramTreeDrawer.createGraph(p));
                runEvaluation(new PrimalityTestingSamplesGenerator(), p, 10000, quiet: true);
            }
            //runEvaluation(new ErraticSequenceLengthSamplesGenerator(), getProgram1(), 10000);
        }