Пример #1
0
        public MainWindow()
        {
            InitializeComponent();
            PsatSim psatSim = new PsatSim();

            //trebuie selectate din interfata precum si populationCount

            //generare configuratii random


            flag = true;
            var dir     = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86);
            var dirInfo = new DirectoryInfo(dir + "\\PSATSim\\Traces");

            FileInfo[] info = dirInfo.GetFiles("*.tra");
            for (int i = 0; i < info.Length; i++)
            {
                listView.Items.Add(new CheckBox()
                {
                    Name    = "Trace" + i,
                    Content = info[i].Name
                });
            }
            foreach (var item in listView.Items)
            {
                if (item.GetType() == typeof(CheckBox))
                {
                    ((CheckBox)item).Checked += checkBox_Checked;
                }
            }
            buttonInit.IsEnabled  = false;
            buttonNSGA.IsEnabled  = false;
            buttonSPEA.IsEnabled  = false;
            buttonReset.IsEnabled = false;
        }
Пример #2
0
 public GeneticAlgorithms(List <string> selectedTraces, int populationSize)
 {
     this.selectedTraces = selectedTraces;
     sim                 = new PsatSim();
     random              = new Random();
     simulationResults   = new SimulationResults();
     this.populationSize = populationSize;
 }