示例#1
0
        public void Test_AStar_TakeShohamToSchool()
        {
            GraphExplorer gExplorer    = null;
            IPath         searchResult = null;
            IVertex       start        = null;
            IVertex       destination  = null;

            start       = m_graph.Vertices["Hana 40"];
            destination = m_graph.Vertices["Khoogim"];

            gExplorer    = new GraphExplorer(m_graph);
            searchResult = gExplorer.AStar(start, destination);

            Assert.AreEqual("Hana 29", searchResult.NextVertex(m_graph.Vertices["Hana 40"]).Name);
        }
示例#2
0
        public void Test_AStar_NoPath()
        {
            GraphExplorer gExplorer    = null;
            IPath         searchResult = null;
            IVertex       start        = null;
            IVertex       destination  = null;

            start       = m_graph.Vertices["Shlomzion-Wizo"];
            destination = m_graph.Vertices["Khoogim"];

            gExplorer    = new GraphExplorer(m_graph);
            searchResult = gExplorer.AStar(start, destination);

            Assert.IsNull(searchResult);
        }
示例#3
0
        public void Test_AStar_Boorekas()
        {
            GraphExplorer gExplorer    = null;
            IPath         searchResult = null;
            IVertex       start        = null;
            IVertex       destination  = null;

            start       = m_graph.Vertices["Hana 40"];
            destination = m_graph.Vertices["Z. Carmelia"];

            gExplorer    = new GraphExplorer(m_graph);
            searchResult = gExplorer.AStar(start, destination);

            Assert.AreEqual("Rachel 2", searchResult.NextVertex(m_graph.Vertices["Rachel Fork"]).Name);
        }
示例#4
0
        public void Test_AStar_StartIsTheGoal()
        {
            GraphExplorer gExplorer    = null;
            IPath         searchResult = null;
            IVertex       start        = null;
            IVertex       destination  = null;

            start       = m_graph.Vertices["Hana 40"];
            destination = m_graph.Vertices["Hana 40"];

            gExplorer    = new GraphExplorer(m_graph);
            searchResult = gExplorer.AStar(start, destination);

            Assert.AreEqual("Hana 40", searchResult.StartVertex.Name);
            Assert.IsNull(searchResult.NextVertex(start));
        }