Exemple #1
0
        private void buttonShowTree_Click(object sender, EventArgs e)
        {
            if (matrice != null)
            {
                isGraphInMemory.Visible  = false;
                isGraphInMemory2.Visible = false;
                var g = new SearchTree();
                Algorithme_AEtoile(g);
                Node2 N0 = new Node2();
                N0.numero = numinitial;
                var l = g.RechercheSolutionAEtoile2(N0);

                Node2 NEnd = (Node2)l.Last();

                var lastFerme = g.L_Fermes;
                lastFerme.Add(NEnd);
                var drawForm = new TreeDrawForm(lastFerme);
                drawForm.ShowDialog();
                reussite2 = drawForm.GetReussite();
                groupBoxCor2Part.Visible = true;
                buttonQuitter.Visible    = true;
            }
            else
            {
                isGraphInMemory.Visible  = true;
                isGraphInMemory2.Visible = true;
            }
        }
Exemple #2
0
        private bool Algorithme_AEtoile(SearchTree g)
        {
            Node2 N0 = new Node2();

            N0.numero = numinitial;
            List <GenericNode> solution = g.RechercheSolutionAEtoile2(N0);

            Node2 N1 = N0;

            for (int i = 1; i < solution.Count; i++)
            {
                Node2 N2 = (Node2)solution[i];
                listBox1.Items.Add(Convert.ToString(N1.numero)
                                   + "--->" + Convert.ToString(N2.numero)
                                   + "   : " + Convert.ToString(matrice[N1.numero, N2.numero]));
                N1 = N2;
            }

            g.GetSearchTree(treeViewCorrection);

            bool reussite = false;

            reussite = (Correction(historiqueUtiFerme, g.historiqueIAFermes) && (Correction(historiqueUtiOuvert, g.historiqueIAOuverts)));
            return(reussite);
        }