} // scheduleUnscheduableEvents public Slot getCorrespondingSlot(Slot selectedSlot) { return(Program.slots.Find(delegate(Slot compareSlot) { return (compareSlot.getDay() == selectedSlot.getDay() && compareSlot.getTime() == selectedSlot.getTime() && compareSlot.getWeek() != selectedSlot.getWeek()); })); } // getCorrespondingSlot
} // getCorrespondingSlot public bool enoughTimeInDay(Slot s, Event e) { List <Slot> remainingSlotsInDay = new List <Slot>(); for (int i = 0; i < Program.slots.Count; i++) { if ((Program.slots[i].getDay() == s.getDay()) && (Program.slots[i].getWeek() == s.getWeek())) { remainingSlotsInDay.Add(Program.slots[i]); } } if (((remainingSlotsInDay.IndexOf(s) + e.getDuration()) > remainingSlotsInDay.Count)) { return(false); } else { return(true); } } // enoughTimeInDay
} // hasEventBeenScheduled public bool hasLunchBeenScheduled(Slot s, Event e) { int numberTimesScheduled = (from g in chromosome where g.getEvent() == e && g.getSlot().getDay() == s.getDay() select g).Count(); if (numberTimesScheduled == 1) { return(true); } else { return(false); } } // hasLunchBeenScheduled
public bool enoughTimeInDay(Slot s, Event e) { List<Slot> remainingSlotsInDay = new List<Slot>(); for (int i = 0; i < Program.slots.Count; i++) { if ((Program.slots[i].getDay() == s.getDay()) && (Program.slots[i].getWeek() == s.getWeek())) remainingSlotsInDay.Add(Program.slots[i]); } if (((remainingSlotsInDay.IndexOf(s) + e.getDuration()) > remainingSlotsInDay.Count)) return false; else return true; }
public bool hasLunchBeenScheduled(Slot s, Event e) { int numberTimesScheduled = (from g in chromosome where g.getEvent() == e && g.getSlot().getDay() == s.getDay() select g).Count(); if (numberTimesScheduled == 1) return true; else return false; }
public Slot getCorrespondingSlot(Slot selectedSlot) { return Program.slots.Find(delegate(Slot compareSlot) { return (compareSlot.getDay() == selectedSlot.getDay() && compareSlot.getTime() == selectedSlot.getTime() && compareSlot.getWeek() != selectedSlot.getWeek()); }); }