Ejemplo n.º 1
0
        public void setupFitnessFunction(string fitnessFunction)
        {
            foreach (Type t in this.GetType().Assembly.GetTypes())
            {
                if (t.GetInterface("IFitnessFunction", true) != null)
                {
                    this.functionComboBox.Items.Add(t.Name);
                }
            }

            fitFun = FitnessFunctionFactory.getFitnessFunction(fitnessFunction);
            if (fitFun != null)
            {
                for (int j = 0; j < functionComboBox.Items.Count; j++)
                {
                    if (functionComboBox.Items[j].ToString().Equals(fitFun.name))
                    {
                        functionComboBox.SelectedIndex = j;
                        break;
                    }
                }
            }
            fillFitnessDescription();
        }
Ejemplo n.º 2
0
 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     fitFun = FitnessFunctionFactory.getFitnessFunction(this.functionComboBox.SelectedItem.ToString());
     fillFitnessDescription();
 }