Esempio n. 1
0
        public void TestTwoNeighboursOneWay()
        {
            var tags    = new TagsTableCollectionIndex();
            var graph   = new DynamicGraphRouterDataSource <LiveEdge>(tags);
            var vertex1 = graph.AddVertex(0, 0);
            var vertex2 = graph.AddVertex(1, 1);
            var vertex3 = graph.AddVertex(2, 2);
            var edge    = new LiveEdge()
            {
                Distance = 100,
                Forward  = true,
                Tags     = tags.Add(new TagsCollection(
                                        Tag.Create("FOW", "2"),
                                        Tag.Create("FRC", "3"),
                                        Tag.Create("ONEWAY", "FT")))
            };

            graph.AddEdge(vertex1, vertex2, edge, null);
            graph.AddEdge(vertex2, vertex3, edge, null);

            var encoder = new OpenLR.Referenced.MultiNet.ReferencedMultiNetEncoder(new BasicRouterDataSource <LiveEdge>(graph),
                                                                                   new EncoderMock());

            Assert.IsFalse(encoder.IsVertexValid(vertex2));
        }
Esempio n. 2
0
        public void TestCarriageWaySplit()
        {
            var tags    = new TagsTableCollectionIndex();
            var graph   = new DynamicGraphRouterDataSource <LiveEdge>(tags);
            var vertex1 = graph.AddVertex(51.22218f, 5.87950f);
            var vertex2 = graph.AddVertex(51.22183f, 5.88044f);
            var vertex3 = graph.AddVertex(51.22149f, 5.88149f);
            var vertex4 = graph.AddVertex(51.22144f, 5.88147f);
            var edge1   = new LiveEdge()
            {
                Distance = 100,
                Forward  = true,
                Tags     = tags.Add(new TagsCollection(
                                        Tag.Create("ONEWAY", string.Empty),
                                        Tag.Create("FRC", "2"),
                                        Tag.Create("FOW", "3")))
            };
            var edge2 = new LiveEdge()
            {
                Distance = 100,
                Forward  = true,
                Tags     = tags.Add(new TagsCollection(
                                        Tag.Create("ONEWAY", "TF"),
                                        Tag.Create("FRC", "2"),
                                        Tag.Create("FOW", "2")))
            };
            var edge3 = new LiveEdge()
            {
                Distance = 100,
                Forward  = true,
                Tags     = tags.Add(new TagsCollection(
                                        Tag.Create("ONEWAY", "FT"),
                                        Tag.Create("FRC", "2"),
                                        Tag.Create("FOW", "2")))
            };

            graph.AddEdge(vertex1, vertex2, edge1, null);
            graph.AddEdge(vertex2, vertex3, edge2, null);
            graph.AddEdge(vertex2, vertex4, edge3, null);

            var encoder = new OpenLR.Referenced.MultiNet.ReferencedMultiNetEncoder(new BasicRouterDataSource <LiveEdge>(graph),
                                                                                   new EncoderMock());

            Assert.IsFalse(encoder.IsVertexValid(vertex2));
        }
Esempio n. 3
0
        public void TestRoundaboutExit()
        {
            var tags    = new TagsTableCollectionIndex();
            var graph   = new DynamicGraphRouterDataSource <LiveEdge>(tags);
            var vertex1 = graph.AddVertex(51.22069f, 5.88442f);
            var vertex2 = graph.AddVertex(51.22056f, 5.88426f);
            var vertex3 = graph.AddVertex(51.22046f, 5.88434f);
            var vertex4 = graph.AddVertex(51.22059f, 5.88414f);
            var edge1   = new LiveEdge()
            {
                Distance = 100,
                Forward  = true,
                Tags     = tags.Add(new TagsCollection(
                                        Tag.Create("ONEWAY", string.Empty),
                                        Tag.Create("FRC", "2"),
                                        Tag.Create("FOW", "3")))
            };
            var edge2 = new LiveEdge()
            {
                Distance = 100,
                Forward  = true,
                Tags     = tags.Add(new TagsCollection(
                                        Tag.Create("ONEWAY", "TF"),
                                        Tag.Create("FRC", "2"),
                                        Tag.Create("FOW", "4")))
            };
            var edge3 = new LiveEdge()
            {
                Distance = 100,
                Forward  = true,
                Tags     = tags.Add(new TagsCollection(
                                        Tag.Create("ONEWAY", "FT"),
                                        Tag.Create("FRC", "2"),
                                        Tag.Create("FOW", "4")))
            };

            graph.AddEdge(vertex1, vertex2, edge1, null);
            graph.AddEdge(vertex2, vertex3, edge2, null);
            graph.AddEdge(vertex2, vertex4, edge3, null);

            var encoder = new OpenLR.Referenced.MultiNet.ReferencedMultiNetEncoder(new BasicRouterDataSource <LiveEdge>(graph),
                                                                                   new EncoderMock());

            Assert.IsTrue(encoder.IsVertexValid(vertex2));
        }