Пример #1
0
        public Camion(Controlador c, Faena faena, string tipo_camion, double[] tiempos)
        {
            this.componentes = new List<Componente>();
            this.faena = faena;
            this.faena.agregar_camion(this);
            this.c = c;
            this.tiempo_creacion = this.c.T_simulacion;
            this.muerto = false;
            this.tipo_camion = tipo_camion;

            //También, aquí se crean los componentes asociados al camión
            //componente_camion = Input.tasa_falla_componentes[tipo_camion];
            //Alamos he cambiado la estructura del input, favor revísalo

            //Se crean los componentes, se les asignan los tiempos
            actualizar_tiempos(tiempos[0],tiempos[1], tiempos[2]);
            foreach (var par in Input.tasa_falla_componentes[tipo_camion])
            {
                for (int i=0;i<Input.componentes_por_camion[this.tipo_camion][par.Key];i++)
                {
                    bool usado=false;
                    if (this.tiempo_inicializacion > 0) usado=true;
                    Componente componente = new Componente(this.c, this, par.Key,par.Value,usado);
                    this.agregar_componente(componente);
                }
            }
        }
Пример #2
0
        public static void Main(string[] args)
        {
            string ruta_root = "/home/jia200x/Dropbox/Proyecto KOMATSU/Input/nuevas estructuras/";
            /*Input.Inicializar(@"E:\Dropbox\Proyecto KOMATSU (1)\Input\nuevas estructuras\Input_Faenas.csv",
                @"E:\Dropbox\Proyecto KOMATSU (1)\Input\nuevas estructuras\input_probabilidad envio.csv",
                @"E:\Dropbox\Proyecto KOMATSU (1)\Input\nuevas estructuras\Input_ingresos_programados.csv",
                @"E:\Dropbox\Proyecto KOMATSU (1)\Input\nuevas estructuras\Input_reemplazos.csv",
                @"E:\Dropbox\Proyecto KOMATSU (1)\Input\nuevas estructuras\Input_mortalidad.csv",
                @"E:\Dropbox\Proyecto KOMATSU (1)\Input\nuevas estructuras\Input_falla_componentes.csv",
                @"E:\Dropbox\Proyecto KOMATSU (1)\Input\nuevas estructuras\Input_ponderadores.csv",
                @"E:\Dropbox\Proyecto KOMATSU (1)\Input\nuevas estructuras\Input_componentes_por_camion.csv");*/

            Input.Inicializar(ruta_root+"Input_Faenas.csv",
                ruta_root+"input_probabilidad envio.csv",
                ruta_root+"In_ingresos_prog_proyec1.csv",
                ruta_root+"Input_reemplazos.csv",
                ruta_root+"Input_mortalidad.csv",
                ruta_root+"Input_falla_componentes.csv", ruta_root+"Input_ponderadores.csv",
                ruta_root+"Input_componentes_por_camion.csv");

            //Agregar una faena de prueba
            Controlador c = new Controlador((365*24*20));
            List<Faena> lf= new List<Faena>();
            foreach(var f in Input.ponderadores)
            {
                Console.Write (f.Key);
                Faena fa = new Faena(c,f.Key);
                lf.Add (fa);
            }
            Console.WriteLine("Comienza la simulación");
            //Validar estructura
            foreach(Faena f in lf)
            {
                foreach(Camion camion in f.camiones)
                {
                    foreach(Componente comp in camion.componentes)
                    {

                    }
                }
            }
            VaciadoBatch vb = new VaciadoBatch(c,lf);
            c.Run();
        }
Пример #3
0
 public Componente(Controlador c, Camion camion, string tipo_componente, double[] tasas_falla, bool usado=false)
 {
     this.c = c;
     this.camion = camion;
     this.tipo_componente = tipo_componente;
     this.tasas_falla = tasas_falla;
     //Si el camion esta usado, se debe obtener cuando es el punto en que falla
     //Console.WriteLine ("Se ha generado el siguiente tiempo de falla para el componente {0} en {1}",tipo_componente,30);
     if(usado == false)
     {
         double sgte_tiempo = generar_tiempo_de_falla((int)camion.edad);
         //Si el siguiente tiempo de falla es mayor a la hora en que muere el camión, no agregarlo a eventos
         if(this.c.T_simulacion+sgte_tiempo < this.camion.tiempo_muerte)
             generar_siguiente_tiempo(sgte_tiempo);
     }
     else
     {
         //Paradoja de inspección
         double horas_funcionamiento = this.camion.tiempo_inicializacion;
         double tasa_trabajo = this.camion.tasa_trabajo;
         double a_func = horas_funcionamiento/tasa_trabajo;
         int edad_camion = 0;
         double t=0;
         double r;
         while(true)
         {
             t += generar_tiempo_de_falla(edad_camion);
             r = t/(365*24);
             if(r <= a_func)
             {
                 edad_camion+=(int)r;
             }
             else
             {
                 double sgte_tiempo = t-a_func*(365*24);
                 if(this.c.T_simulacion+sgte_tiempo < this.camion.tiempo_muerte)
                     generar_siguiente_tiempo(sgte_tiempo);
                 break;
             }
         }
     }
 }
Пример #4
0
        public Faena(Controlador c, string Nombre)
        {
            this.c = c;
            this.camiones = new List<Camion>();
            this.batch = new List<Componente>();
            this.Nombre = Nombre;
            this.ponderador = Input.ponderadores[this.Nombre][0];

            //Se agregan los camiones por faena...
            try
            {
                foreach (var dato in Input.tiempo_vida_camion[this.Nombre])
                {
                    Camion cam = new Camion(this.c, this, dato.arr_string[0], new double[]{dato.arr_double[1], dato.arr_double[0], dato.arr_double[2]});
                }
            }
            catch
            {
            }
        }
Пример #5
0
 public VaciadoBatch(Controlador c, List<Faena> faenas)
 {
     this.c = c;
     this.faenas = faenas;
     generar_siguiente_tiempo(RNGen.Expo(6)*24);
 }