Пример #1
0
        /// <summary>
        /// Obtient la liste des GenericNode successeurs du noeud courant dans le graphe graph, à partir de la matrice d'adjacence graph.AdjacentMatrix.
        /// </summary>
        /// <returns></returns>
        public override List <GenericNode> GetSuccessors()
        {
            List <GenericNode> successors = new List <GenericNode>();

            for (int i = 0; i < graph.NbNodes; i++)
            {
                if (graph.AdjacentMatrix[Num, i] != -1)
                {
                    AlphaBetNode successor = new AlphaBetNode(i, graph);
                    successors.Add(successor);
                }
            }
            return(successors);
        }
Пример #2
0
        /// <summary>
        /// Cout de l'arc séparant le noeud courant du GenericNode genNode.
        /// </summary>
        /// <param name="genNode"></param>
        /// <returns></returns>
        public override double GetArcCost(GenericNode genNode)
        {
            AlphaBetNode alphaNode = (AlphaBetNode)genNode;

            return(graph.AdjacentMatrix[Num, alphaNode.Num]);
        }
Пример #3
0
        public override bool IsEqual(GenericNode genNode)
        {
            AlphaBetNode alphaNode = (AlphaBetNode)genNode;

            return(Num == alphaNode.Num);
        }