override protected IMethod updateMethod()
        {
            ElicitationParameters par = p.getClone();

            try {
                par.cred = 0.5;
                string resposta = this.p.center + "";
                par.answers = this.answers;
                par.answers.Add(resposta);
                par.x = (Double[])this.x.Clone();

                par.times = this.times;

                this.statistics.Add(Convert.ToDouble(lista[lista.Length - 8]));
                this.statistics.Add(Convert.ToDouble(lista[lista.Length - 7]));
                this.statistics.Add(Convert.ToDouble(lista[lista.Length - 6]));
                this.statistics.Add(Convert.ToDouble(lista[lista.Length - 5]));
                par.statistics = statistics;
                par.min        = this.p.min;
                par.center     = this.p.center;
                par.max        = this.p.max;
                par.iteracao   = this.p.iteracao;
                par.index++;

                Bisection bisection = new Bisection(par, this.ifPrincipal);

                return(bisection);
            } catch (Exception ex) {
                throw;
            }
        }
        public override void BT_back_ClickAction(object sender, EventArgs e)
        {
            base.BT_back_ClickAction(sender, e);
            try{
                Engine.EngineInterface.deleteChildren(this.p.min, this.p.center, this.p.max);
            } catch (Exception exc) {
                MessageBox.Show(exc.Message + "-----------\n" + exc.StackTrace);
            }

            IMethod method = methodManager.getCurrentMethod();

            if (method != null)
            {
                Bisection b = (Bisection)method;
                b.RB_semPreferencia.Checked = false;
                if (ifPrincipal.isTrainingPhase() == false)
                {
                    ((Bisection)method).markChoosableAreaChartSeries(((Bisection)method).p.min, ((Bisection)method).middlePoint, ((Bisection)method).p.max);
                }
            }
        }
Example #3
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);
            }
        }