Exemple #1
0
 public Form0(sbyte METHOD, Variable variable, IFormPrincipal iFormPrincipal)
 {
     this.ifPrincipal = iFormPrincipal;
     this.METHOD      = METHOD;
     this.variable    = variable;
     InitializeComponent();
     ifPrincipal.getWatch().Reset();
     ifPrincipal.getWatch().Start();
 }
Exemple #2
0
        private void BT_Avançar_Click(object sender, EventArgs e)
        {
            new TimeEvent(this.ifPrincipal.getQuestion(), TimeEvent.EventType.LEAVE_FIRST_PANEL_OF_ELICITATION, access.process);
            ifPrincipal.getWatch().Stop();
            this.timeComsumption = ifPrincipal.getWatch().ElapsedMilliseconds;
            ifPrincipal.getWatch().Reset();
            ElicitationParameters p = new ElicitationParameters();

            try
            {
                p.max = Convert.ToDouble(TB_ValorMaximo.Text);
                p.min = Convert.ToDouble(TB_ValorMinimo.Text);
                if (p.min < p.max || p.min == p.max)
                {
                    verificar = true;
                }
                else
                {
                    ifPrincipal.DisplayMessage(DefaultConfig.ST_TXT_VALUES_IRREGULARS_MINMAX, true);
                }
            }
            catch
            {
                ifPrincipal.DisplayMessage(DefaultConfig.ST_TXT_VALUES_TYPE_WROTE, true);
            }

            if (verificar == true)
            {
                Firmino   firmino;
                Bisection bisection;
                Panel     panel1 = null;

                string resposta = TB_ValorMinimo.Text + ';' + TB_ValorMaximo.Text;

                p.center = (p.max + p.min) / 2;
                p.index  = -1;
                p.times.Add(timeComsumption / 1000);
                p.answers.Add(resposta);
                p.creds.Add(0.0);//Passando credibilidade nula para não construir outra condicional no momento do back
                //statistics.Add(0);//passando estatistica nula para não desagrupar as respostas e estatisticas
                p.statistics.AddRange(new double[4] {
                    0, 0, 0, 0
                });
                p.W = new double[2] {
                    0, 0
                };

                if (this.METHOD.Equals(Engine.EngineInterface.FIRMINO))
                {
                    //firmino = new Firmino("", p.min, p.center, p.max, 1, -1, 0, p.times,
                    //    p.answers, p.statistics, p.creds, this.ifPrincipal);
                    firmino = new Firmino(p, this.ifPrincipal);
                    //Cria o objeto firmino chamando a classe Firmino. Here thexpert has chose [min, max] with credib=1.0
                    //firmino.ReceberReferenciadoFrom0(this);//Metodo que faz com que seja possivel o form0 chamar ele proprio
                    panel1        = firmino.panel1;
                    currentMethod = (IMethod)firmino;
                }
                else if (this.METHOD.Equals(Engine.EngineInterface.BISECTION))
                {
                    bisection = new Bisection(p, this.ifPrincipal);
                    //bisection = new Bisection("", p.min, p.center, p.max, 1, -1, 0, p.times,
                    //    p.answers, p.statistics, this.ifPrincipal);//Cria o objeto firmino chamando a classe Firmino. Here thexpert has chose [min, max] with credib=1.0
                    //bisection.ReceberReferenciadoFrom0(this);//Metodo que faz com que seja possivel o form0 chamar ele proprio
                    //panel1 = bisection.mainPanel;
                    currentMethod = (IMethod)bisection;
                }

                this.ifPrincipal.addNewIteraction(currentMethod);
            }
        }