Exemplo n.º 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);
                }
            }
        }
Exemplo n.º 2
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);
                }
            }
        }
Exemplo n.º 3
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();
        }
Exemplo n.º 4
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();
        }