public void Calc() { DateTime start__full_time = DateTime.Now; List <int> gen_index = prepareGenerateCalc(); List <int> leant_index = prepareLearnCalc(); make_Log(Log_line.Start, TimerValue: start__full_time); int currentstep = 0; int all_step = (Rules_generator.Count() + Learn_algorithms.Count() * Repeat_into) * Repeat_renew_global; currentstep = Make_inform_back_process(currentstep, all_step); // Parallel.For(0, Repeat_renew_global, i => for (int i = 0; i < Repeat_renew_global; i++) { createFSSamplesSet(); DateTime start__curle_time = DateTime.Now; #region Генерация make_Log(Log_line.StartGenerate, TimerValue: start__curle_time, FS: FuzzySystem); if (Rules_generator.Count() == 0 && (is_UFS)) { loadFSUFS(); } for (int ad = 0; ad < Rules_generator.Count(); ad++) { make_Log(Log_line.PreGenerate_log, name_Alg: Rules_generator[ad].ToString()); FuzzySystem = Rules_generator[ad].Generate(FuzzySystem, Rules_generator_conf[gen_index[ad]]); currentstep = Make_inform_back_process(currentstep, all_step); make_Log(Log_line.PostGenerate_log, FuzzySystem, name_Alg: Rules_generator[ad].ToString(true)); if (is_autosave) { save_FS(FuzzySystem, Name_alg: Rules_generator[ad].ToString()); } GC.Collect(); } #endregion make_Log(Log_line.StartOptimaze, FuzzySystem); for (int j = 0; j < Repeat_into; j++) { #region Оптимизация for (int l = 0; l < Learn_algorithms.Count(); l++) { make_Log(Log_line.PreOptimaze_log, name_Alg: Learn_algorithms[l].ToString()); FuzzySystem = Learn_algorithms[l].TuneUpFuzzySystem(FuzzySystem, Learn_algorithm_conf[leant_index[l]]); currentstep = Make_inform_back_process(currentstep, all_step); make_Log(Log_line.PostOptimaze_log, FS: FuzzySystem, name_Alg: Learn_algorithms[l].ToString(true)); if (is_autosave) { save_FS(FuzzySystem, Learn_algorithms[l].ToString()); } GC.Collect(); } #endregion } make_Log(Log_line.EndCircle, TimerSpan: (DateTime.Now - start__curle_time)); GC.Collect(); } // ); make_Log(Log_line.End, TimerSpan: DateTime.Now - start__full_time); }
public override void Calc() { DateTime start__full_time = DateTime.Now; List <int> gen_index = prepare_generate_to_Calc(); List <int> leant_index = prepare_learn_to_Calc(); make_Log(Log_line.Start, TimerValue: start__full_time); int currentstep = 0; int all_step = (Rules_generator.Count() + Learn_algorithms.Count() * Repeat_into) * Repeat_renew_global; currentstep = Make_inform_back_process(currentstep, all_step); // Parallel.For(0, Repeat_renew_global, i => LOG = ""; for (int i = 0; i < Repeat_renew_global; i++) { Approx_Singletone = new TSAFuzzySystem(Approx_learn_set, Approx_test_set); DateTime start__curle_time = DateTime.Now; #region Генерация аппроксиматора make_Log(Log_line.StartGenerate, TimerValue: start__curle_time); if (Rules_generator.Count() == 0 && (is_UFS)) { Approx_Singletone = TSAFSUFSLoader.loadUFS(Approx_Singletone, UFS_file_name); } for (int ad = 0; ad < Rules_generator.Count(); ad++) { make_Log(Log_line.PreGenerate_log, name_Alg: Rules_generator[ad].ToString()); Approx_Singletone = Rules_generator[ad].Generate(Approx_Singletone as TSAFuzzySystem, Rules_generator_conf[gen_index[ad]]) as TSAFuzzySystem; currentstep = Make_inform_back_process(currentstep, all_step); make_Log(Log_line.PostGenerate_log, Approx_Singletone, name_Alg: Rules_generator[ad].ToString(true)); if (is_autosave) { save_FS(Approx_Singletone, Name_alg: Rules_generator[ad].ToString()); } GC.Collect(); } #endregion make_Log(Log_line.StartOptimaze, Approx_Singletone); for (int j = 0; j < Repeat_into; j++) { #region Оптимизация аппроксиматора for (int l = 0; l < Learn_algorithms.Count(); l++) { make_Log(Log_line.PreOptimaze_log, name_Alg: Learn_algorithms[l].ToString()); Approx_Singletone = Learn_algorithms[l].TuneUpFuzzySystem(Approx_Singletone as TSAFuzzySystem, Learn_algorithm_conf[leant_index[l]]) as TSAFuzzySystem; currentstep = Make_inform_back_process(currentstep, all_step); make_Log(Log_line.PostOptimaze_log, FS: Approx_Singletone, name_Alg: Learn_algorithms[l].ToString(true)); if (is_autosave) { save_FS(Approx_Singletone, Learn_algorithms[l].ToString()); } GC.Collect(); } #endregion } make_Log(Log_line.EndCircle, TimerSpan: (DateTime.Now - start__curle_time)); GC.Collect(); } // ); make_Log(Log_line.End, TimerSpan: DateTime.Now - start__full_time); }