private void btnHLRun_Click(object sender, EventArgs e) { HLOptions opt = CreateHLOptions(); Solution = HLAlgorithm <CiSDecision> .Execute( CiSTarget.F, new CiSDecisionSpace(N), opt); DisplayDecisionOnDatagrid(dgSolution, Solution); DisplayChartFOnIteration(chartFOnIteration, HLAlgorithm <CiSDecision> .FLog); }
private HLOptions CreateHLOptions() { HLOptions opt = new HLOptions(); int iVal; double dVal; if (int.TryParse(txtHLK.Text, out iVal)) { opt.K = iVal; } else { MessageBox.Show(string.Format("K is not in valid format. {0} is used.", opt.K)); } if (double.TryParse(txtHLEps.Text, out dVal)) { opt.Eps = dVal; } else { MessageBox.Show(string.Format("Eps is not in valid format. {0} is used.", opt.Eps)); } if (double.TryParse(txtHLMinEps.Text, out dVal)) { opt.Min = dVal; } else { MessageBox.Show(string.Format("Min is not in valid format. {0} is used.", opt.Min)); } if (double.TryParse(txtHLInc.Text, out dVal)) { opt.Inc = dVal; } else { MessageBox.Show(string.Format("Inc is not in valid format. {0} is used.", opt.Inc)); } if (double.TryParse(txtHLDec.Text, out dVal)) { opt.Dec = dVal; } else { MessageBox.Show(string.Format("Dec is not in valid format. {0} is used.", opt.Dec)); } return(opt); }
private HLOptions CreateHLOptions() { HLOptions opt = new HLOptions(); int iVal; double dVal; if (int.TryParse(txtHLK.Text, out iVal)) { opt.K = iVal; } else { MessageBox.Show(string.Format("K is not in valid format. {0} is used.", opt.K)); } if (double.TryParse(txtHLEps.Text, out dVal)) { opt.Eps = dVal; } else { MessageBox.Show(string.Format("Eps is not in valid format. {0} is used.", opt.Eps)); } if (double.TryParse(txtHLMinEps.Text, out dVal)) { opt.Min = dVal; } else { MessageBox.Show(string.Format("Min is not in valid format. {0} is used.", opt.Min)); } if (double.TryParse(txtHLInc.Text, out dVal)) { opt.Inc = dVal; } else { MessageBox.Show(string.Format("Inc is not in valid format. {0} is used.", opt.Inc)); } if (double.TryParse(txtHLDec.Text, out dVal)) { opt.Dec = dVal; } else { MessageBox.Show(string.Format("Dec is not in valid format. {0} is used.", opt.Dec)); } return opt; }