Exemplo n.º 1
0
 private void Escenario1()
 {
     grafo = new GrafoMatriz<int>();
     grafo.AgregarVertice(1);
     grafo.AgregarVertice(2);
     grafo.AgregarVertice(3);
 }
Exemplo n.º 2
0
 private void Escenario1()
 {
     grafo = new GrafoMatriz <int>();
     grafo.AgregarVertice(1);
     grafo.AgregarVertice(2);
     grafo.AgregarVertice(3);
 }
Exemplo n.º 3
0
 private void Escenario3()
 {
     grafo = new GrafoMatriz <int>();
     grafo.AgregarVertice(1);
     grafo.AgregarVertice(2);
     grafo.AgregarVertice(3);
     grafo.AgregarArista(1, 3, 2.0);
     grafo.AgregarArista(1, 2, 3.0);
     grafo.AgregarArista(2, 1, 1.0);
 }
Exemplo n.º 4
0
 private void Escenario2()
 {
     Console.WriteLine("Prueba escenario 2");
     grafo = new GrafoMatriz <int>();
     grafo.AgregarVertice(1);
     grafo.AgregarVertice(2);
     grafo.AgregarVertice(3);
     grafo.AgregarArista(0, 2, 2.0);
     grafo.AgregarArista(0, 1, 3.0);
 }
Exemplo n.º 5
0
        private void Escenario3()
        {
            grafo = new GrafoMatriz<int>();
            grafo.AgregarVertice(1);
            grafo.AgregarVertice(2);
            grafo.AgregarVertice(3);
            grafo.AgregarArista(1, 3, 2.0);
            grafo.AgregarArista(1, 2, 3.0);
            grafo.AgregarArista(2, 1, 1.0);

        }
Exemplo n.º 6
0
        private void Escenario2()
        {
            Console.WriteLine("Prueba escenario 2");
            grafo = new GrafoMatriz<int>();
            grafo.AgregarVertice(1);
            grafo.AgregarVertice(2);
            grafo.AgregarVertice(3);
            grafo.AgregarArista(0, 2, 2.0);
            grafo.AgregarArista(0, 1, 3.0);

        }
Exemplo n.º 7
0
 public void cargarEstaciones(List <Estacion> est)
 {
     for (int i = 0; i < est.Count; i++)
     {
         Estaciones.AgregarVertice(est[i]);
     }
 }
Exemplo n.º 8
0
        public void TestAgregarVertice()
        {
            Escenario();
            grafo.AgregarVertice(5);
            int esp = 1;
            int act = grafo.CantidadVertices();

            Assert.AreEqual(esp, act);
        }
Exemplo n.º 9
0
        private void Escenario1(){
            c = new CargadoraInformacion(@"..\\..\\..\\SimulacionSistemaTransporteMasivoMio\Almacenamiento\Base de datos\");
            matriz = new GrafoMatriz<Stop>();
            c.AlmacenarInformacion("TRIPTYPES.txt");
            c.AlmacenarInformacion("SCHEDULETYPES.txt");
            c.AlmacenarInformacion("DATAPLAN.txt");
            c.AlmacenarInformacion("ARCS.txt");
            c.AlmacenarInformacion("CALENDAR.txt");
            c.AlmacenarInformacion("LINES.txt");
            c.AlmacenarInformacion("LINESARCS.txt");
            c.AlmacenarInformacion("LINESTOPS.txt");
            c.AlmacenarInformacion("PLANVERSIONS.txt");
            c.AlmacenarInformacion("SCHEDULEPROFILES.txt");
            c.AlmacenarInformacion("STOPS.txt");
            c.AlmacenarInformacion("TASKS.txt");
            c.AlmacenarInformacion("TRIPS.txt");

            for (int i = 0; i < c.STOPS.Count; i++)
            {
                try
                {
                    matriz.AgregarVertice(c.STOPS[i]);
                }
                catch (Exception)
                {

                }
            }
            for (int i = 0; i < c.ARCS.Count; i++)
            {
                int inicio = -1;
                int fin = -1;
                for (int j = 0; j < c.STOPS.Count; j++)
                {
                    if (c.ARCS[i].StopIdStart == c.STOPS[j].StopId)
                    {
                        inicio = j;
                    }
                    if (c.STOPS[j].StopId == c.ARCS[i].StopIdEnd)
                    {
                        fin = j;
                    }
                }
                
                    //try
                    //{
                        matriz.AgregarArista(inicio, fin, c.ARCS[i].ArcLenght);
                    //}
                    //catch (Exception)
                    //{

                    //}
               
              
            }

        }
Exemplo n.º 10
0
        private void Escenario1()
        {
            c      = new CargadoraInformacion(@"..\\..\\..\\SimulacionSistemaTransporteMasivoMio\Almacenamiento\Base de datos\");
            matriz = new GrafoMatriz <Stop>();
            c.AlmacenarInformacion("TRIPTYPES.txt");
            c.AlmacenarInformacion("SCHEDULETYPES.txt");
            c.AlmacenarInformacion("DATAPLAN.txt");
            c.AlmacenarInformacion("ARCS.txt");
            c.AlmacenarInformacion("CALENDAR.txt");
            c.AlmacenarInformacion("LINES.txt");
            c.AlmacenarInformacion("LINESARCS.txt");
            c.AlmacenarInformacion("LINESTOPS.txt");
            c.AlmacenarInformacion("PLANVERSIONS.txt");
            c.AlmacenarInformacion("SCHEDULEPROFILES.txt");
            c.AlmacenarInformacion("STOPS.txt");
            c.AlmacenarInformacion("TASKS.txt");
            c.AlmacenarInformacion("TRIPS.txt");

            for (int i = 0; i < c.STOPS.Count; i++)
            {
                try
                {
                    matriz.AgregarVertice(c.STOPS[i]);
                }
                catch (Exception)
                {
                }
            }
            for (int i = 0; i < c.ARCS.Count; i++)
            {
                int inicio = -1;
                int fin    = -1;
                for (int j = 0; j < c.STOPS.Count; j++)
                {
                    if (c.ARCS[i].StopIdStart == c.STOPS[j].StopId)
                    {
                        inicio = j;
                    }
                    if (c.STOPS[j].StopId == c.ARCS[i].StopIdEnd)
                    {
                        fin = j;
                    }
                }

                //try
                //{
                matriz.AgregarArista(inicio, fin, c.ARCS[i].ArcLenght);
                //}
                //catch (Exception)
                //{

                //}
            }
        }
Exemplo n.º 11
0
 private void EscenarioMuchosVertices()
 {
     grafo = new GrafoMatriz <int>();
     for (int i = 0; i < 1001; i++)
     {
         grafo.AgregarVertice(i);
     }
     for (int i = 0; i < 1000; i++)
     {
         grafo.AgregarArista(i, i + 1, 5);
     }
 }
Exemplo n.º 12
0
 private void EscenarioMuchosVertices()
 {
     grafo = new GrafoMatriz<int>();
     for (int i = 0; i < 1001; i++)
     {
         grafo.AgregarVertice(i);
     }
     for (int i = 0; i < 1000; i++)
     {
         grafo.AgregarArista(i, i + 1, 5);
     }
 }
Exemplo n.º 13
0
        private void EscenarioDijkstra()
        {
            grafo = new GrafoMatriz<int>();
            grafo.AgregarVertice(1);
            grafo.AgregarVertice(2);
            grafo.AgregarVertice(3);
            grafo.AgregarVertice(4);
            grafo.AgregarVertice(5);
            grafo.AgregarVertice(6);
            grafo.AgregarVertice(7);
            grafo.AgregarVertice(8);
            grafo.AgregarVertice(9);
            grafo.AgregarVertice(10);
            grafo.AgregarVertice(11);
            grafo.AgregarVertice(12);
            grafo.AgregarVertice(13);
            grafo.AgregarArista(0, 1, 2.0);
            grafo.AgregarArista(1, 0, 2.0);
            grafo.AgregarArista(1, 2, 1.0);
            grafo.AgregarArista(2, 1, 1.0);
            grafo.AgregarArista(2, 3, 1.0);
            grafo.AgregarArista(3, 2, 1.0);
            grafo.AgregarArista(3, 4, 2.0);
            grafo.AgregarArista(4, 3, 2.0);
            grafo.AgregarArista(2, 5, 2.0);
            grafo.AgregarArista(5, 2, 2.0);
            grafo.AgregarArista(5, 6, 2.0);
            grafo.AgregarArista(6, 5, 2.0);
            grafo.AgregarArista(6, 7, 2.0);
            grafo.AgregarArista(7, 6, 2.0);
            grafo.AgregarArista(7, 8, 1.0);
            grafo.AgregarArista(8, 9, 1.0);
            grafo.AgregarArista(7, 11, 1.0);
            grafo.AgregarArista(11, 7, 1.0);
            grafo.AgregarArista(7, 10, 1.0);
            grafo.AgregarArista(10, 7, 1.0);
            grafo.AgregarArista(9, 10, 1.0);
            grafo.AgregarArista(10, 9, 1.0);
            grafo.AgregarArista(11, 12, 1.0);
            grafo.AgregarArista(12, 11, 1.0);

        }
Exemplo n.º 14
0
 private void EscenarioDijkstra()
 {
     grafo = new GrafoMatriz <int>();
     grafo.AgregarVertice(1);
     grafo.AgregarVertice(2);
     grafo.AgregarVertice(3);
     grafo.AgregarVertice(4);
     grafo.AgregarVertice(5);
     grafo.AgregarVertice(6);
     grafo.AgregarVertice(7);
     grafo.AgregarVertice(8);
     grafo.AgregarVertice(9);
     grafo.AgregarVertice(10);
     grafo.AgregarVertice(11);
     grafo.AgregarVertice(12);
     grafo.AgregarVertice(13);
     grafo.AgregarArista(0, 1, 2.0);
     grafo.AgregarArista(1, 0, 2.0);
     grafo.AgregarArista(1, 2, 1.0);
     grafo.AgregarArista(2, 1, 1.0);
     grafo.AgregarArista(2, 3, 1.0);
     grafo.AgregarArista(3, 2, 1.0);
     grafo.AgregarArista(3, 4, 2.0);
     grafo.AgregarArista(4, 3, 2.0);
     grafo.AgregarArista(2, 5, 2.0);
     grafo.AgregarArista(5, 2, 2.0);
     grafo.AgregarArista(5, 6, 2.0);
     grafo.AgregarArista(6, 5, 2.0);
     grafo.AgregarArista(6, 7, 2.0);
     grafo.AgregarArista(7, 6, 2.0);
     grafo.AgregarArista(7, 8, 1.0);
     grafo.AgregarArista(8, 9, 1.0);
     grafo.AgregarArista(7, 11, 1.0);
     grafo.AgregarArista(11, 7, 1.0);
     grafo.AgregarArista(7, 10, 1.0);
     grafo.AgregarArista(10, 7, 1.0);
     grafo.AgregarArista(9, 10, 1.0);
     grafo.AgregarArista(10, 9, 1.0);
     grafo.AgregarArista(11, 12, 1.0);
     grafo.AgregarArista(12, 11, 1.0);
 }