public void reinit() { for (int i = 0; i < RulesDatabaseSet.Count; i++) { KnowlegeBaseTSARulesWithError temp = new KnowlegeBaseTSARulesWithError(RulesDatabaseSet[i]); RulesDatabaseSet[i] = temp; } }
internal static List <KnowlegeBaseTSARules> WeedsRegenerateIteration(TSAFuzzySystem fuzzy, KnowlegeBaseTSARules b, double delta, Random rand, int count) { var rez = new List <KnowlegeBaseTSARules>(); for (int k = 0; k < count; k++) { var bforedit = new KnowlegeBaseTSARules(b); bforedit.error = fuzzy.ErrorLearnSamples(bforedit); rez.Add(bforedit); } return(rez); }
internal static List <KnowlegeBaseTSARules> WeedsRegenerateIteration(TSAFuzzySystem fuzzy, KnowlegeBaseTSARules b, double delta, Random rand, int count) { var rez = new List <KnowlegeBaseTSARules>(); for (int k = 0; k < count; k++) { var bforedit = new KnowlegeBaseTSARulesWithError(b); foreach (var rule in bforedit.RulesDatabase) { for (int i = 0; i < rule.ListTermsInRule.Count; i++) { var term = rule.ListTermsInRule[i]; for (int index = 0; index < term.Parametrs.Length; index++) { term.Parametrs[index] += fuzzy.LearnSamplesSet.InputAttributes[i].Scatter * delta * Math.Sqrt(-2 * Math.Log(rand.NextDouble())) * Math.Cos(2 * Math.PI * rand.NextDouble()); } } } bforedit.error = fuzzy.ErrorLearnSamples(bforedit); rez.Add(bforedit); } return(rez); }