Example #1
0
        public Individ(KnowlegeBaseTSARules Source, SampleSet data, int count_vars, bool the_first, Random rand, FuzzySystem.FuzzyAbstract.learn_algorithm.conf.ESConfig.Type_init par_type_init)
        {
            hrom_vector       = new Hromosom(new KnowlegeBaseTSARules(Source));
            step_sko          = new List <double>(count_vars);
            step_rotate       = new List <double>(count_vars);
            count_step_sko    = count_vars;
            count_step_rotate = count_vars;
            Data = data;
            for (int i = 0; i < count_vars; i++)
            {
                step_sko.Add(0 + rand.NextDouble() * (data.InputAttributes[i].Scatter * 0.05));
                step_rotate.Add(-1 * Math.PI + rand.NextDouble() * 2 * Math.PI);
            }
            if (!the_first)
            {
                switch (par_type_init)
                {
                case FuzzySystem.FuzzyAbstract.learn_algorithm.conf.ESConfig.Type_init.Случайная: hrom_vector.init_random(rand, data); break;

                case FuzzySystem.FuzzyAbstract.learn_algorithm.conf.ESConfig.Type_init.Ограниченная: hrom_vector.init_constrain(rand, data); break;
                }
            }
        }