Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Graph g = new Graph();
            NodeTaquin N0 = new NodeTaquin(textBox1.Text);
            List<GenericNode> Lres = g.RechercheSolutionAEtoile(N0);

            if (Lres.Count == 0)
            {
                labelsolution.Text = "Pas de solution";
            }
            else
            {   labelsolution.Text = "Une solution a été trouvée";
                foreach (GenericNode N in Lres)
                {
                    listBox1.Items.Add( N);
                }
                labelcountopen.Text = "Nb noeuds des ouverts : " + g.CountInOpenList().ToString();
                labelcountclosed.Text = "Nb noeuds des fermés : "+ g.CountInClosedList().ToString();
                g.GetSearchTree( treeView1 );
            }
        }
Exemple #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            SearchTree         g    = new SearchTree();
            NodeTaquin         N0   = new NodeTaquin(textBox1.Text);
            List <GenericNode> Lres = g.RechercheSolutionAEtoile(N0);

            if (Lres.Count == 0)
            {
                labelsolution.Text = "Pas de solution";
            }
            else
            {
                labelsolution.Text = "Une solution a été trouvée";
                foreach (GenericNode N in Lres)
                {
                    listBox1.Items.Add(N);
                }
                labelcountopen.Text   = "Nb noeuds des ouverts : " + g.CountInOpenList().ToString();
                labelcountclosed.Text = "Nb noeuds des fermés : " + g.CountInClosedList().ToString();
                g.GetSearchTree(treeView1);
            }
        }
Exemple #3
0
        public override bool IsEqual(GenericNode N2)
        {
            NodeTaquin NT = (NodeTaquin)(N2);

            return(NT.Name == Name);
        }