/// <summary> /// Тест!!! /// </summary> public void Test() { foreach (IAlgorithm alg in algorithms) { BlackBoxFunction function = new BlackBoxFunction(); alg.SetFunction(function); CalculatingThread th = new CalculatingThread(alg, tasks, function); thListener = new Listener(listener); th.SetEndListener(thListener); th.Start(); } }
/// <summary> /// Заглушка на алгоритмы. /// </summary> private void Create_Algorithms() { BlackBoxFunction function = new BlackBoxFunction(); DataFormat.DataFormat data = new DataFormat.DataFormat(); data.OpenFile("Tests/test_1.txt"); ITaskPackage package = data.GetData(); List <ITaskPackage> tasks = new List <ITaskPackage>(); tasks.Add(package); test_system.TestSystem system = new test_system.TestSystem(tasks, function); Algorithms = new List <Algorithm.IAlgorithm>(); system.AddAlgorithm(new Algorithm.Benchmark_Algorithm(null, function)); system.SetListener(this); system.Test(); }
/// <summary> /// Конструктор /// </summary> public TestSystem(List <ITaskPackage> tasks, BlackBoxFunction function) { this.tasks = tasks; this.function = function; algorithms = new List <IAlgorithm>(); }
/// <summary> /// Инициализация потока для алгоритма /// </summary> /// <param name="alg">Алгоритм</param> /// <param name="tasks">Задания</param> /// <param name="function">Оптимизируемая функция</param> /// public CalculatingThread(IAlgorithm alg, List <ITaskPackage> tasks, BlackBoxFunction function) { this.alg = alg; this.tasks = tasks; this.function = function; }