private void Rectangle_MouseDown_2(object sender, MouseButtonEventArgs e) { SpotIntro form = new SpotIntro(); updateList d = form.updateList; d(spotList); form.Show(); //this.Close(); }
private void ButtonS_Click(object sender, RoutedEventArgs e) { if ((Parent1.IsChecked == true || Parent2.IsChecked == true || Parent3.IsChecked == true) && (Time1.IsChecked == true || Time2.IsChecked == true || Time3.IsChecked == true) && (Kind1.IsChecked == true || Kind2.IsChecked == true || Kind3.IsChecked == true)) { //WayResult form = new WayResult(); //update d = form.updata; updata(Combobox1.SelectedItem.ToString(), Budget.Text, customerWeight); Matrix Weight_P = new Matrix(3, 26, PublicV.Parent); Matrix Weight_K = new Matrix(3, 26, PublicV.Kind); Matrix Weight_T = new Matrix(3, 26, PublicV.Time); double[,] Weight = new double[9, 26]; for (int i = 0; i < 3; i++) { for (int j = 0; j < 26; j++) { Weight[i, j] = Weight_P.GetValue(i, j); Weight[i + 3, j] = Weight_T.GetValue(i, j); Weight[i + 6, j] = Weight_K.GetValue(i, j); } } Matrix Message = new Matrix(9, 26, Weight); Message = Algorithm.CityCash * Message; Message = Message.MulCount(0, 10); AntAlgorithm way = new AntAlgorithm(); way.AntSet(PublicV.Traffic, Message.ToArray(), 0.8, 1, 1, 0.7, 1); PublicV.Route = way.FindingWay(Algorithm.BeginPoint); PublicV.RouteName.Add(PublicV.NumToName[Algorithm.BeginPoint]); for (int i = 0; i < PublicV.Route.Length - 1; i++) { //if (cash + PublicV.Traffic[PublicV.Route[i], PublicV.Route[i + 1]] + PublicV.Ticket[Algorithm.BeginPoint] > Algorithm.limitcash) //{ // break; //} if (i == Algorithm.BeginPoint - 1) { continue; } if (i >= Algorithm.lengthmax) { break; } PublicV.RouteName.Add(PublicV.NumToName[PublicV.Route[i] + 1]); } SpotIntro form = new SpotIntro(); updatelist d = form.updatelist; d(PublicV.RouteName); form.Show(); this.Close(); //form.Show(); } else { MessageBox.Show("请填写相关信息!"); } }