public IPlan RecaulculatePlan(WorkerInfo workerInfo)
        {
            BasicPlan plan = new BasicPlan();

            int   currentWorker = workerInfo.GetMinWorker();
            ITask result        = null;
            int   min           = Int32.MaxValue;

            foreach (var task in _taskList)
            {
                int singlefitnessval = FitnessFunction(workerInfo, currentWorker, task);
                if (singlefitnessval < min)
                {
                    min    = singlefitnessval;
                    result = task;
                }
            }

            if (result != null)
            {
                Console.WriteLine("Winner: " + result.ToString() + " MIN: " + min);
                plan.Plan.Add(result, currentWorker);
                _taskList.Remove(result);
            }



            return(plan);
        }
        public IPlan PreparePlan(WorkerInfo workerInfo, IEnumerable <ITask> taskList)
        {
            Dictionary <int, int> workersTime = new Dictionary <int, int>(workerInfo.WorkersTimeToEnd);
            var plan  = new BasicPlan();
            var tasks = new List <ITask>(taskList);

            tasks.Sort(new TaskComparer());
            foreach (var task in tasks)
            {
                var minIndex = GetMin(workersTime);
                plan.Plan.Add(task, minIndex);
                workersTime[minIndex] += task.EstimatedTime;
            }

            return(plan);
        }