public ConstraintResult Check(Schedule sched)
        {
            bool pass = true;
            StringBuilder errorContainer = new StringBuilder();
            for (int day = 0; day < 6; day++)
            {
                if (sched[day].Count == 0)
                {
                    continue;
                }
                for (int groupN = 0; groupN < Configuration.Instance.Groups.Count - 1; groupN++)
                {
                    var group = Configuration.Instance.Groups[groupN];

                    for (int classsN = 0; classsN < sched[day][group].Count; classsN++)
                    {
                        int groupN2 = groupN + 1;
                        while (groupN2 < Configuration.Instance.Groups.Count)
                        {
                            var group2 = Configuration.Instance.Groups[groupN2];
                            if (sched[day][group].Count != 0 && sched[day][group2].Count != 0)
                            {
                                var classs = sched[day][group][classsN];
                                var classs2 = sched[day][group2][classsN];

                                if (classs.Course.Professor == classs2.Course.Professor)
                                {
                                    var start1 = sched.GetStartTimeForClass(day, group, classs);
                                    var start2 = sched.GetStartTimeForClass(day, group2, classs2);
                                    var end1 = start1 + classs.Length;
                                    var end2 = start2 + classs2.Length;
                                    if (end1 >= start2 && start2 <= end1 && end1 <= end2)
                                    {
                                        pass = false;
                                        string error = string.Format("Professor conflict: professor {0} conflicts between group {1} and group {2} in day {3}",
                                            classs.Course.Professor, group, group2, day);
                                        errorContainer.AppendLine(error);
                                    }
                                }
                            }
                            groupN2++;
                        }

                    }
                }
            }
            return new ConstraintResult(pass, errorContainer.ToString());
        }
        public ConstraintResult Check(Schedule sched)
        {

            bool pass = true;
            StringBuilder errorContainer = new StringBuilder();
            
            foreach (var req in requirements)
            {
                int day = req.Day;

                if (sched[day].Count == 0)
                {
                    continue;
                }
                foreach (var group in Configuration.Instance.Groups)
                {
                    foreach (var classs in sched[day][group])
                    {
                        if (classs.Course.Professor == req.Professor)
                        {
                            TimeSpan classStart = sched.GetStartTimeForClass(day, group, classs);
                            TimeSpan classEnd = classStart + classs.Length;
                            if ((classStart >= req.Start && classStart <= req.End) || (classEnd >= req.Start && classEnd <= req.End))
                            {
                                pass = false;
                                string error = string.Format("Conflict: professor {0} does not want to work on {3} between {1:hh\\:mm}-{2:hh\\:mm}",
                                    req.Professor, classStart, classEnd, ConversionServices.GetDayNameFromDayNumber(req.Day));
                                errorContainer.AppendLine(error);
                            }
                        }
                    }
                }
            }
            return new ConstraintResult(pass, errorContainer.ToString().Trim());
        }
        public ConstraintResult Check(Schedule sched)
        {
            bool pass = true;
            StringBuilder errorContainer = new StringBuilder();

            for (int day = 0; day < 6; day++)
            {
                if (sched[day].Count == 0)
                {
                    continue;
                }
                foreach (var group in Configuration.Instance.Groups)
                {
                    foreach (var classs in sched[day][group])
                    {
                        if (classs.Course.Professor == prof)
                        {
                            TimeSpan classStart = sched.GetStartTimeForClass(day, group, classs);
                            TimeSpan classEnd = classStart + classs.Length;
                            if( (classStart>=start && classStart<=end) || (classEnd>=start && classEnd<=end) ){
                                pass = false;
                                string error = string.Format("Professor Time Off conflict: professor {0} conflicts between {1}-{2}",
                                    prof, classStart, classEnd);
                                errorContainer.AppendLine(error);
                            }
                        }
                    }
                }
            }
            return new ConstraintResult(pass, errorContainer.ToString());
        }