Beispiel #1
0
        public override List <GenericNode> GetListSucc()
        {
            List <GenericNode> lsucc = new List <GenericNode>();

            for (int i = 0; i < Dijkstra.nbnodes; i++)
            {
                if (Dijkstra.matrice[numero, i] != -1)
                {
                    Node2 newnode2 = new Node2();
                    newnode2.numero = i;
                    lsucc.Add(newnode2);
                }
            }
            return(lsucc);
        }
Beispiel #2
0
        private void AEtoile()
        {
            SearchTree g  = new SearchTree();
            Node2      N0 = new Node2();

            N0.numero = numinitial;
            List <GenericNode> solution = g.RechercheSolutionAEtoile(N0, OuvertsLB, FermesLB);

            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(treeView1);
            treeView1.Nodes[0].Text = ALPHABET[numinitial].ToString();
            treeView1.SelectedNode  = treeView1.Nodes[0];
        }
Beispiel #3
0
        public override double GetArcCost(GenericNode N2)
        {
            Node2 N2bis = (Node2)N2;

            return(Dijkstra.matrice[numero, N2bis.numero]);
        }
Beispiel #4
0
        // Méthodes abstrates, donc à surcharger obligatoirement avec override dans une classe fille
        public override bool IsEqual(GenericNode N2)
        {
            Node2 N2bis = (Node2)N2;

            return(numero == N2bis.numero);
        }