Ejemplo n.º 1
0
        private void ResetButtonClick(object sender, RoutedEventArgs e)
        {
            initialState                  = null;
            actionSeq                     = null;
            showPathBtn.IsEnabled         = false;
            resetToInitStateBtn.IsEnabled = false;

            env.Reset();
        }
Ejemplo n.º 2
0
        private void ShowRoute(object sender, DoWorkEventArgs e)
        {
            ActionSecuence actions = (e.Argument as WorkerArgs).ActionSecuence;
            var            worker  = sender as BackgroundWorker;

            Thread.Sleep(500);
            for (int i = 0; i < actions.Size; i++)
            {
                worker.ReportProgress(i, actions[i]);
                Thread.Sleep(500);
            }
        }
Ejemplo n.º 3
0
        private void SolveButtonClicked(object sender, RoutedEventArgs e)
        {
            initialState = env.GetState();

            if (initialState.Packman != null)
            {
                Algorithms algo = (Algorithms)int.Parse((algorithm.SelectedItem as ComboBoxItem).Tag.ToString());

                actionSeq = ProblemSolver.Solve(initialState, algo);

                MessageBox.Show("Done.");

                resetToInitStateBtn.IsEnabled = true;
                showPathBtn.IsEnabled         = true;
            }
            else
            {
                MessageBox.Show("Packman not set.");
            }
        }