private void Init() { var vars = LinguisticVariableService.Instance.InputLinguisticVariables; if (vars.Count != 2) { return; } for (int x = 0; x < 50; x++) { for (int y = 0; y < 50; y++) { FuzzyLogicQuery flq = new FuzzyLogicQuery (new Dictionary <LinguisticVariable, double> { { vars[0], ((double)vars[0].MaxValue * ((double)x / 50)) + (double)vars[0].MinValue }, { vars[1], ((double)vars[1].MaxValue * ((double)y / 50)) + (double)vars[1].MinValue } }); resultsMap[x, y] = new Point((double)x / 50, (double)y / 50, flq.Execute()); } } NormalizationMap(); }
private void Execute_Click(object sender, RoutedEventArgs e) { FuzzyLogicQuery query = new FuzzyLogicQuery(CreateQueryParams()); ctrResultTB.Text = $"{LinguisticVariableService.Instance.OutputLinguisticVariables.FirstOrDefault().Name ?? "Result"}: {query.Execute()}"; }