void ResetBools() { this.isMethodParams = false; this.isFuncParams = false; this.isCalculating = false; this.isLogsNeed = true; this.isWorkNotStarted = true; currentMethodSettings = null; graphic = null; DihtomiaPanel.Enabled = true; ModMetPanel.Enabled = true; }
void SetupFunctionParams() { FunctionPanel.FunctionGetParams += FunctionPanel_FunctionGetParams; void FunctionPanel_FunctionGetParams(OptimizingFunction func, LipzitsFunction lipz, List <double> lowerBound, List <double> upperBound) { if (isWorkNotStarted) { isWorkNotStarted = false; if (isDihtomiaCurrentMethod) { SolutionPanel.PrintTextInLogs("Метод неравномерных покрытий использующий принцип дихтомии"); ModMetPanel.Enabled = false; } else { SolutionPanel.PrintTextInLogs("Метод неравномерных покрытий модификация Н.К.Арутюновой"); DihtomiaPanel.Enabled = false; } } if (currentMethodSettings == null) { if (isDihtomiaCurrentMethod) { currentMethodSettings = new DihtomiaParams(); } else { currentMethodSettings = new ModificatedParams(); } } currentMethodSettings.Function = func; currentMethodSettings.Lipzits = lipz; currentMethodSettings.LowerPoint = lowerBound; currentMethodSettings.UpperPoint = upperBound; Logs($"Первая точка начальной области-[{string.Join(", ",lowerBound)}] \nВторая-[{string.Join(", ", upperBound)}]"); this.isFuncParams = true; AllReady(); } }
void SetupDihtomiaParams() { DihtomiaPanel.DihtomiaGetParams += DihtomiaPanel_DihtomiaGetParams; void DihtomiaPanel_DihtomiaGetParams(double precision, double lipzitsParam, RuleD rule) { if (isWorkNotStarted) { isWorkNotStarted = false; Logs("Метод неравномерных покрытий использующий принцип дихтомии"); ModMetPanel.Enabled = false; } if (currentMethodSettings == null) { currentMethodSettings = new DihtomiaParams(); } currentMethodSettings.Precision = precision; currentMethodSettings.LipzitsParametr = lipzitsParam; ((DihtomiaParams)currentMethodSettings).Rule = rule; Logs($"Точность метода={precision} \nПараметр константы Липшица={lipzitsParam} \nПравило выбора параллелограмма={rule.ToString()}"); this.isMethodParams = true; AllReady(); } }
void SetupModMetParams() { ModMetPanel.ModificatedMethodGetParams += ModMetPanel_ModificatedMethodGetParams; void ModMetPanel_ModificatedMethodGetParams(double precision, double lipzitsParam, RuleM ruleMainList, RuleM ruleSubList) { if (isWorkNotStarted) { isWorkNotStarted = false; Logs("Метод неравномерных покрытий модификация Н.К.Арутюновой"); DihtomiaPanel.Enabled = false; } if (currentMethodSettings == null) { currentMethodSettings = new ModificatedParams(); } currentMethodSettings.Precision = precision; currentMethodSettings.LipzitsParametr = lipzitsParam; ((ModificatedParams)currentMethodSettings).MainRule = ruleMainList; ((ModificatedParams)currentMethodSettings).SubRule = ruleSubList; Logs($"Точность метода={precision} \nПараметр константы Липшица={lipzitsParam} \nПравило добавления в основной список={ruleMainList.ToString()}\nПравило добавления в подсписок={ruleSubList.ToString()}"); this.isMethodParams = true; AllReady(); } }