Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            float[] inputs = new float[6];
            float   temp;

            temp      = float.Parse(maskedTextBox1.Text);
            inputs[0] = (temp - (float)35.0) / ((float)42.0 - (float)35.0);

            if (checkBox1.Checked)
            {
                inputs[1] = 1;
            }
            else
            {
                inputs[1] = 0;
            }

            if (checkBox2.Checked)
            {
                inputs[2] = 1;
            }
            else
            {
                inputs[2] = 0;
            }

            if (checkBox3.Checked)
            {
                inputs[3] = 1;
            }
            else
            {
                inputs[3] = 0;
            }

            if (checkBox4.Checked)
            {
                inputs[4] = 1;
            }
            else
            {
                inputs[4] = 0;
            }

            if (checkBox5.Checked)
            {
                inputs[5] = 1;
            }
            else
            {
                inputs[5] = 0;
            }

            groupBox2.Enabled = true;

            float[] outputs = Fann.run(ann, inputs);

            if (outputs[0] > 0.5)
            {
                checkBox6.Checked = true;
            }
            else
            {
                checkBox6.Checked = false;
            }

            if (outputs[1] > 0.5)
            {
                checkBox7.Checked = true;
            }
            else
            {
                checkBox7.Checked = false;
            }

            textBox1.Text = outputs[0].ToString();
            textBox2.Text = outputs[1].ToString();
        }
Exemple #2
0
 public void Dispose()
 {
     Fann.destroy(ann);
 }