Exemplo n.º 1
0
        //Inicialize
        private void fillBlank()
        {
            int i, j;

            for (i = 0; i < 140; i++)
            {
                for (j = 0; j < 140; j++)
                {
                    universo[i, j] = new Cell();
                }
            }
        }
Exemplo n.º 2
0
        // contacts
        private void fillRandXNum(int no, int stat, int latent)
        {
            int j = 0;

                while(j < no)
                {
                    int eX = r.Next(0, 140);
                    int eY = r.Next(0, 140);
                    Cell tmp = universo[eX, eY];

                    //restriccion solo con celulas con diferente status
                    // restriccion de vaccinados pero en infectados no afecta a vaccinados
                    if (stat == 3)
                    {
                        if (tmp.getCellStatus() != stat && tmp.getCellStatus() < 5)
                            {

                                universo[eX, eY] = new Cell(stat, latent);
                                j++;

                            }
                    }
                    else if (tmp.getCellStatus() != stat)
                    {
                                universo[eX, eY] = new Cell(stat, latent);
                                j++;

                    }
                    tmp = null;
                }
        }
Exemplo n.º 3
0
        // actualiza la matriz con el puntero
        private void drawPointMatrix(int x,int y)
        {
            int period = 0;

            if (conf.pointerSel == 3)
            {
                g.FillRectangle(Brushes.Yellow, x, y, 4, 4);

                period = conf.infectiousP;

            }
            else if (conf.pointerSel == 5)
            {
                g.FillRectangle(Brushes.SkyBlue, x, y, 4, 4);

            }
            else if (conf.pointerSel == 6)
            {
                g.FillRectangle(Brushes.Black, x, y, 4, 4);
            }

            universo[x / 4, y / 4] = new Cell(conf.pointerSel,period);
            //pintamos en la matriz
            pictureBox1.Image = saveGraph;
        }