예제 #1
0
        public void TestAgregarVertice()
        {
            Escenario();
            grafo.AgregarVertice(5);
            int esp = 1;
            int act = grafo.CantidadVertices();

            Assert.AreEqual(esp, act);
        }
예제 #2
0
        public void StartSim()
        {
            //for (int i = 0; i < Estaciones.DarVertices().Length; i++)
            //{
            //    System.Threading.Thread hilo = new System.Threading.Thread(new System.Threading.ThreadStart(Estaciones.DarVertices()[i].Run));
            //    hilo.Start();
            //}
            while (Timer < SIM_TIME_WEEK)
            {
                AtiendeSimulacion();

                for (int i = 0; i < Estaciones.CantidadVertices(); i++)
                {
                    Estaciones.DarVertices()[i].AtiendeEstacion(Timer, Estaciones);
                }

                for (int i = 0; i < Buses.Count; i++)
                {
                    if (Buses[i].Eliminar())
                    {
                        Buses.RemoveAt(i);
                    }
                    Buses[i].AtiendeBus(Timer, Estaciones);
                }

                Console.WriteLine("Tiempo de simulación: " + Timer);
                Timer += 1;

                //System.Threading.Thread.Sleep(UnidadReloj);
            }
            Console.WriteLine("Terminó la simulación");
        }
예제 #3
0
        public void TestCargaCompletaVertices()
        {
            Escenario1();
            int esp = 1867;
            int act = matriz.CantidadVertices();

            Assert.AreEqual(esp, act);
        }