Beispiel #1
0
        public bool IsOverallFeasible()
        {
            bool isFeasible = false;

            for (int i = 0; i < Machines.Count; i++)
            {
                if (Settings.IsAllMachinesUtilized && Machines.Count(mc => !mc.IsThirdParty) <= Jobs.Count && !Machines[i].IsThirdParty && Machines[i].AssignedJobs.Count == 0)
                {
                    return(false);
                }

                if (Machines.Count >= Jobs.Count && Machines[i].IsCompulsary && Machines[i].AssignedJobs.Count == 0)
                {
                    return(false);
                }

                for (int j = 0; j < Machines[i].AssignedJobs.Count; j++)
                {
                    if (IsFeasible(Machines[i], Machines[i].AssignedJobs[j]))
                    {
                        isFeasible = true;
                    }
                    else
                    {
                        return(false);
                    }
                }
            }

            return(isFeasible);
        }