예제 #1
0
        public void TestSimpleWeighedDynamicGraphVertex()
        {
            PreProcessedDynamicGraph graph = new PreProcessedDynamicGraph();
            uint vertex = graph.AddVertex(51, 4);

            float latitude, longitude;
            graph.GetVertex(vertex, out latitude, out longitude);

            Assert.AreEqual(51, latitude);
            Assert.AreEqual(4, longitude);

            KeyValuePair<uint, PreProcessedEdge>[] arcs = graph.GetArcs(vertex);
            Assert.AreEqual(0, arcs.Length);
        }
예제 #2
0
        public void TestSimpleWeighedDynamicGraphVertex10000()
        {
            PreProcessedDynamicGraph graph = new PreProcessedDynamicGraph();
            int count = 10000;
            while (count > 0)
            {
                uint vertex = graph.AddVertex(51, 4);

                float latitude, longitude;
                graph.GetVertex(vertex, out latitude, out longitude);

                Assert.AreEqual(51, latitude);
                Assert.AreEqual(4, longitude);

                KeyValuePair<uint, PreProcessedEdge>[] arcs = graph.GetArcs(vertex);
                Assert.AreEqual(0, arcs.Length);

                count--;
            }

            Assert.AreEqual((uint)10000, graph.VertexCount);
        }