Block DEFAULT(Check the source code of block DEFAULT)

@block DEFAULT
  |_@block Timetable_Data
  |_@block Timetable
    |_@block Generators
      |_@block Room_Booking
      |_@block Student_Attendance
    |_@block Basic_Functional_System
      |_@block Different_Lecturer
      |_@block Different_Room
      |_@block Different_Room_Bis
      |_@block Different_Unit
      |_@block Lecturer_not_Teach_Unit
      |_@block Other_Commitments
      |_@block Room_Capacity
    |_@block Extension_1
      |_@block LunchBreak
      |_@block PreferredTeachingTime
    |_@block ExtraFeature
    |_@block Display

Subblocks

Encoding of the predicates used to generate the timetable.
These include:
_timesteps which represent a full week (1 timestep = 2 hours, 5 timesteps per day)
_units, how many hours they should be taught per week and how many hours each student enrolled should attend,
_students, who take units and attend lectures,
_lecturers, who teach units (at preferred teaching times and not when they have other commitments),
_rooms and their student capacity.

@block DEFAULT
  |_@block Timetable_Data
  |_@block Timetable
    |_@block Generators
      |_@block Room_Booking
      |_@block Student_Attendance
    |_@block Basic_Functional_System
      |_@block Different_Lecturer
      |_@block Different_Room
      |_@block Different_Room_Bis
      |_@block Different_Unit
      |_@block Lecturer_not_Teach_Unit
      |_@block Other_Commitments
      |_@block Room_Capacity
    |_@block Extension_1
      |_@block LunchBreak
      |_@block PreferredTeachingTime
    |_@block ExtraFeature
    |_@block Display

Term Descriptions

  • T: T is a timestep ranging from 1 to 25 during which a lecture can be scheduled if possible
  • U: U is a unit taught by a single lecturer and taken by multiple students S
  • S: S is a student who takes units and attends lectures
  • H: H is the number of lectures scheduled for a unit AND the number of scheduled lectures a student must take for a single unit
  • R: R is a room where a lecture takes place
  • C: C is a room capacity to limit the number of students attending a lecture at the same time
  • L: L is a lecturer who teaches a unit
  • O: O is a timestep at which a lecturer has other commitments and therefore cannot teach
  • P: P is a timestep at which a lecturer would like to teach if it is possible

Hidden Atoms

  • timesteps(T)
    the amount of slots in which lectures can be scheduled
    • T: T is a timestep ranging from 1 to 25 during which a lecture can be scheduled if possible
  • takes(U, S)
    a student name's S and a unit U he is enrolled in
    • U: U is a unit taught by a single lecturer and taken by multiple students S
    • S: S is a student who takes units and attends lectures
  • hoursStudentUnit(H, U)
    the number of hours a student should attend for each unit
    • H: H is the number of lectures scheduled for a unit AND the number of scheduled lectures a student must take for a single unit
    • U: U is a unit taught by a single lecturer and taken by multiple students S
  • room(R, C)
    a room name's R and its student capacity
    • R: R is a room where a lecture takes place
    • C: C is a room capacity to limit the number of students attending a lecture at the same time
  • hoursUnit(H, U)
    how many hours a unit is taught by a lecturer
    • H: H is the number of lectures scheduled for a unit AND the number of scheduled lectures a student must take for a single unit
    • U: U is a unit taught by a single lecturer and taken by multiple students S
  • teaches(U, L)
    the lecturer's name L and a unit U he teaches
    • U: U is a unit taught by a single lecturer and taken by multiple students S
    • L: L is a lecturer who teaches a unit
  • commitments(O, L)
    the lecturer L has another commitment at timestep O and cannot teach
    • O: O is a timestep at which a lecturer has other commitments and therefore cannot teach
    • L: L is a lecturer who teaches a unit
  • preferred(P, L)
    the lecturer L would like to teach at timestep P if possible
    • P: P is a timestep at which a lecturer would like to teach if it is possible
    • L: L is a lecturer who teaches a unit

Encoding of Timetabling logic.

@block DEFAULT
  |_@block Timetable_Data
  |_@block Timetable
    |_@block Generators
      |_@block Room_Booking
      |_@block Student_Attendance
    |_@block Basic_Functional_System
      |_@block Different_Lecturer
      |_@block Different_Room
      |_@block Different_Room_Bis
      |_@block Different_Unit
      |_@block Lecturer_not_Teach_Unit
      |_@block Other_Commitments
      |_@block Room_Capacity
    |_@block Extension_1
      |_@block LunchBreak
      |_@block PreferredTeachingTime
    |_@block ExtraFeature
    |_@block Display

Output Atoms

  • roomBooked(T, U, L, R, C)
    represents a scheduled lecture at a timestep T, for a unit U, taught by a lecturer L, in a room R with a student capacity C.
    • attendance(T, U, S, R, C)
      represents a student attending a scheduled lecture at a timestep T, for a unit U, in a room R with a student capacity C.

      Hidden Atoms

      • capacity(T, R, Total)
        represents the number of students Total attending a scheduled lecture at timestep T in a room R.

        Subblocks

        Schedules H lectures in a room at a specified timestep, where lecturers teach their unit and students attend it H times.
        Also satisfies some requirements for the basic functional system stated in the coursework specification, including:
        _ students should have all their units scheduled,
        _ lecturers should have all their units scheduled.
        Note: by including the atoms generated in the first generator into the second one, the rules/constraints applied to schedule lectures for lectures
        are inherited by students since they can only attend lectures which are correctly scheduled (fit all the requirements specified).

        @block DEFAULT
          |_@block Timetable_Data
          |_@block Timetable
            |_@block Generators
              |_@block Room_Booking
              |_@block Student_Attendance
            |_@block Basic_Functional_System
              |_@block Different_Lecturer
              |_@block Different_Room
              |_@block Different_Room_Bis
              |_@block Different_Unit
              |_@block Lecturer_not_Teach_Unit
              |_@block Other_Commitments
              |_@block Room_Capacity
            |_@block Extension_1
              |_@block LunchBreak
              |_@block PreferredTeachingTime
            |_@block ExtraFeature
            |_@block Display

        Subblocks

        Schedules H lectures to be taught by a lecturer L, in a room R (with student capacity C), for a unit U, at timestep T.
        H corresponds to the H of the 'hoursUnit(H,U)' predicate found in 'atoms.lp', which corresponds to the number of lectures that should be scheduled for each unit.

        @block DEFAULT
          |_@block Timetable_Data
          |_@block Timetable
            |_@block Generators
              |_@block Room_Booking
              |_@block Student_Attendance
            |_@block Basic_Functional_System
              |_@block Different_Lecturer
              |_@block Different_Room
              |_@block Different_Room_Bis
              |_@block Different_Unit
              |_@block Lecturer_not_Teach_Unit
              |_@block Other_Commitments
              |_@block Room_Capacity
            |_@block Extension_1
              |_@block LunchBreak
              |_@block PreferredTeachingTime
            |_@block ExtraFeature
            |_@block Display

        Schedules which lectures a student S should attend for units U he is enrolled in, in a room R (with student capacity C), at timestep T.
        Each student must attend H lectures for a unit he takees, where H corresponds to the H of the 'hoursStudentUnit(H,U)' predicate found in 'atoms.lp',
        which corresponds to the number of lectures that a student should attend for each unit he is enrolled in.

        @block DEFAULT
          |_@block Timetable_Data
          |_@block Timetable
            |_@block Generators
              |_@block Room_Booking
              |_@block Student_Attendance
            |_@block Basic_Functional_System
              |_@block Different_Lecturer
              |_@block Different_Room
              |_@block Different_Room_Bis
              |_@block Different_Unit
              |_@block Lecturer_not_Teach_Unit
              |_@block Other_Commitments
              |_@block Room_Capacity
            |_@block Extension_1
              |_@block LunchBreak
              |_@block PreferredTeachingTime
            |_@block ExtraFeature
            |_@block Display

        Constraints & rules are used to satisfy the requirements for the basic functional system stated in the coursework specification, including:
        _ students should not be forced to attend two lectures at the same time,
        _ lecturers cannot teach two units at the same time,
        _ rooms can only be used for one lecture at the time,
        _ lecturers cannot teach when they have other commitments.

        @block DEFAULT
          |_@block Timetable_Data
          |_@block Timetable
            |_@block Generators
              |_@block Room_Booking
              |_@block Student_Attendance
            |_@block Basic_Functional_System
              |_@block Different_Lecturer
              |_@block Different_Room
              |_@block Different_Room_Bis
              |_@block Different_Unit
              |_@block Lecturer_not_Teach_Unit
              |_@block Other_Commitments
              |_@block Room_Capacity
            |_@block Extension_1
              |_@block LunchBreak
              |_@block PreferredTeachingTime
            |_@block ExtraFeature
            |_@block Display

        Subblocks








        Weak constraints are used to satisfy the requirements for extension 1 stated in the coursework specification, including:
        _ lecturers can have preferred teaching times and the timetables take this into account as much as possible.
        _ timetables offer a lunch break where possible.

        @block DEFAULT
          |_@block Timetable_Data
          |_@block Timetable
            |_@block Generators
              |_@block Room_Booking
              |_@block Student_Attendance
            |_@block Basic_Functional_System
              |_@block Different_Lecturer
              |_@block Different_Room
              |_@block Different_Room_Bis
              |_@block Different_Unit
              |_@block Lecturer_not_Teach_Unit
              |_@block Other_Commitments
              |_@block Room_Capacity
            |_@block Extension_1
              |_@block LunchBreak
              |_@block PreferredTeachingTime
            |_@block ExtraFeature
            |_@block Display

        Subblocks

        Adds 10 penalty points for each lecture that is scheduled during the lunchbreak timesteps.
        Lunch breaks are at timesteps 3, 8, 13, 18 and 23
        Weak constraints are used to schedule a lecture during the lunch break if needed, otherwise lectures are scheduled outside lunchbreaks.
        For each lecture scheduled during a lunch break period, 10 penalty points are added to the current model.

        @block DEFAULT
          |_@block Timetable_Data
          |_@block Timetable
            |_@block Generators
              |_@block Room_Booking
              |_@block Student_Attendance
            |_@block Basic_Functional_System
              |_@block Different_Lecturer
              |_@block Different_Room
              |_@block Different_Room_Bis
              |_@block Different_Unit
              |_@block Lecturer_not_Teach_Unit
              |_@block Other_Commitments
              |_@block Room_Capacity
            |_@block Extension_1
              |_@block LunchBreak
              |_@block PreferredTeachingTime
            |_@block ExtraFeature
            |_@block Display


        Extra feature taking into account breaks on Wednesday afternoons for extra activities.
        The rule wednesdayOff books a room at the timesteps corresponding to a wednesday afternoon, thus making sure no lectures can be scheduled during that time.

        @block DEFAULT
          |_@block Timetable_Data
          |_@block Timetable
            |_@block Generators
              |_@block Room_Booking
              |_@block Student_Attendance
            |_@block Basic_Functional_System
              |_@block Different_Lecturer
              |_@block Different_Room
              |_@block Different_Room_Bis
              |_@block Different_Unit
              |_@block Lecturer_not_Teach_Unit
              |_@block Other_Commitments
              |_@block Room_Capacity
            |_@block Extension_1
              |_@block LunchBreak
              |_@block PreferredTeachingTime
            |_@block ExtraFeature
            |_@block Display