You are on page 1of 35

CHAPTER 4: CONSTRUCTION, TESTING AND RESULTS The Timetable Generators mode of operation is quite plain as can be deduced from

the program flowchart. With the exception of a few variables, the preparation of a timetable using this program is the same as the manual process. It is necessary to define some variables which are of external importance to the generator before using the program for its main function. These variables do not play a direct role on the time table generation per se, they indirectly affect the performance of generation algorithms and may determine efficiency and accuracy up to a level that may make or break the program. These variables are found under the Settings form which is immediately visible at start up.

Figure 4.1: The Settings form The Settings form is a panel through which five important variables of the generator can be viewed and changed. The server:port setting is a value pair of which server represents the computer name or internet protocol (IP) address running the MySQL database server and port represents the port number at which the MySQL server listens for requests. In this installation, the MySQL server resides in the local computer so the server value is localhost or its IP equivalent 127.0.0.1 and the port is the default MySQL port number (specified during MySQL installation) 3306. The database setting represents the name of the database out of all the databases a server hosts used by the program. In this case, its value is ttgen which contains all the tables used by the timetable generator for the storage and retrieval of courses, lecturers and the like. The user:password pair is the identification and authentication token. The MySQL database requires a user identity and a password for all input/output (IO) operations performed on the database. In this case, both the user identity and password have the value ttgen. The image repository value is a string which is the full path to a folder (either local or remote on a network) where all images such as lecturer, student or venue pictures are stored. In this case the value is C:\Users\Public\Pictures, a

directory available to all users of the Windows Vista and 7 operating systems. The last setting, iteration maximum is an integer value which, as the name implies, is the maximum number of iterations that possible for the generation of an efficient timetable. This value which is set to 5 by default is the number of trials in which the program tries to reduce the number of infringements (or clashes). If infringements can not be reduced after this number of trials, the generator stops trying. This value is an important factor in the duration of timetable iterations. The value of these settings can be viewed and set by a simple right-click on their icons which results in a menu. The new value of the setting can then be typed in the available box replacing the old after which Edit is clicked effectively changing the value after a confirmation dialog.

Figure 4.2: Editing Generator settings The key steps to creating an efficient timetable using this program can be outlined in three steps. 4.1 Independent Object Definition The time table generator manages an array of objects. These objects have their properties and methods which are collectively used to bring to fruition, the aim of the program. The independent objects of the time table are standalone properties which every time table possesses. These objects properties and their more important methods are described thus.

4.1.1 Courses

Figure 4.3: Selecting the course button The subroutine that is fired (activated) by the click of this button starts up the course form. This form shows a list of courses (if any exists in the database) categorized by levels and the properties of any selected course.

Figure 4.4: Selecting a course from the list of courses To add a new course or perform other operations such as edit or delete on a course, the specific icon of the course (or the list in the event of an addition) is right-clicked. The context menu then appears with some menu items disabled where they do not apply in the context (e.g Save and Cancel are disabled except when adding or editing a course).

Figure 4.5: Context menu for courses The selection of an item from the context menu generates the appropriate response. The Add menu clears the fields so that the properties of the new course can be specified.

Figure 4.6: Supplying course properties After all property values have been entered into the respective fields, the context menu is used to save the newly created course. The resulting success of the operation is then reported via a message box after which the contents of the list are refreshed thereby showing the new course.

Figure 4.7: Completion of course modification 4.1.2 Venues The definition of venues involves the specification of its properties. First of all, when the program is started, the Venues button is selected.

Figure 4.8: Selecting the venue button The click event of this button starts up the venue form. This form shows a list of venues (if any exists in the database) categorized by capacity and the properties of any selected venue.

Figure 4.9: Selecting a venue from the list of venues To add a new venue or perform other operations such as edit or delete on a venue, the specific icon (or picture if specified) of the venue (or the list in the event of an addition) is right-clicked. The context menu then appears with some menu items disabled where they do not apply in the context (e.g Save and Cancel are disabled except when adding or editing a venue).

Figure 4.10: Context menu for venues

The selection of an item from the context menu generates the appropriate response. The Add menu clears the fields so that the properties of the new venue can be specified. The Picture menu selects an existing image to be used for the selected venue.

Figure 4.11: Supplying venue properties After all property values have been entered into the respective fields, the context menu is used to save the newly created venue. The resulting success of the operation is then reported via a message box after which the contents of the list are refreshed thereby showing the new venue.

Figure 4.12: Completion of venue modification 4.1.3 Periods The specification of a periods properties starts when the Periods button is selected.

Figure 4.13: Selecting the period button The click event of this button starts up the period form. This form shows a list of periods (if any exists in the database) categorized by the day of the week and the properties of any selected period.

Figure 4.14: Selecting a period from the list of periods To add a new period or perform other operations such as edit or delete on a period, the specific icon of the period (or the list in the event of an addition) is right-clicked. The context menu then appears with some menu items disabled where they do not apply in the context (e.g Save and Cancel are disabled except when adding or editing a period).

Figure 4.15: Context menu for periods

The selection of an item from the context menu generates the appropriate response. The Add menu clears the fields so that the properties of the new period can be specified.

Figure 4.16: Supplying period properties After all property values have been entered into the respective fields, the context menu is used to save the newly created period. The resulting success of the operation is then reported via a message box after which the contents of the list are refreshed thereby showing the new period.

Figure 4.17: Completion of period modification 4.1.4 Lecturers The specification of a lecturers properties starts when the Lecturers button is selected.

Figure 4.18: Selecting the lecturer button The click event of this button starts up the lecturer form. This form shows a list of lecturers (if any exists in the database) categorized by the lecturer title and the properties of any selected lecturer.

Figure 4.19: Selecting a lecturer from the list of lecturers To add a new lecturer or perform other operations such as edit or delete on a lecturer, the specific icon (or picture if specified) of the lecturer (or the list in the event of an addition) is right-clicked. The context menu then appears with some menu items disabled where they do not apply in the context (e.g Save and Cancel are disabled except when adding or editing a lecturer).

Figure 4.20: Context menu for lecturers

The selection of an item from the context menu generates the appropriate response. The Add menu clears the fields so that the properties of the new lecturer can be specified.

Figure 4.21: Supplying lecturer properties After all property values have been entered into the respective fields, the context menu is used to save the newly created lecturer. The resulting success of the operation is then reported via a message box after which the contents of the list are refreshed thereby showing the new lecturer.

Figure 4.22: Completing lecturer modification

4.1.5 Students The specification of a students properties starts when the Students button is selected.

Figure 4.23: Selecting the student button The click event of this button starts up the student form. This form shows a list of students (if any exists in the database) categorized by the student level and the properties of any selected student.

Figure 4.24: Selecting a student from the list of students To add a new student or perform other operations such as edit or delete on a student, the specific icon (or picture if specified) of the student (or the list in the event of an addition) is right-clicked. The context menu then appears with some menu items disabled where they do not apply in the context (e.g Save and Cancel are disabled except when adding or editing a student).

Figure 4.25: Context menu for students The selection of an item from the context menu generates the appropriate response. The Add menu clears the fields so that the properties of the new student can be specified.

Figure 4.26: Supplying student properties After all property values have been entered into the respective fields, the context menu is used to save the newly created student. The resulting success of the operation is then reported via a message box after which the contents of the list are refreshed thereby showing the new student.

Figure 4.27: Completion of student modification

4.1.6 Timetable

Figure 4.28: Selecting the timetable button The subroutine that is fired by the click of this button starts up the timetable form. This form shows a list of timetables (if any exists in the database) categorized by type (either normal or examination) and the properties of any selected timetable.

Figure 4.29: Selecting a timetable from the list of timetables To add a new timetable or perform other operations such as edit or delete on a timetable, the specific icon of the timetable is right-clicked. The context menu then appears with some menu items disabled where they do not apply in the context (e.g Save and Cancel are disabled except when adding or editing a timetable).

Figure 4.30: Context menu for timetables The selection of an item from the context menu generates the appropriate response. The Add menu clears the fields so that the properties of the new timetable can be specified.

Figure 4.31: Supplying timetable properties After all property values have been entered into the respective fields, the context menu is used to save the newly created timetable. The resulting success of the operation is then reported via a message box after which the contents of the list are refreshed thereby showing the new timetable.

Figure 4.32: Completion of timetable modification 4.2 Dependency Definition As has been stated previously, some of the timetable independent objects are related to other objects which help to further define a timetable. The mapping between objects (hereby defined as parent and child objects) is of the type one to many. All timetable objects except timetables are related to courses (with the course being the child). These include period, venue, lecturer and student. The course object is not a parent of any other object. The timetable object is related to the period object which uses its relationship to the course (and subsequently other objects) to define relationships in the timetable.

Figure 4.33: Pictorial Representation of the Links between the Timetable Objects

4.2.1 Venue Courses The venue course relationship simply put, defines the courses whose lectures hold in a particular venue. This is a one to many mapping as several courses may be taught in a specific venue. To specify this relationship, a venue is selected by clicking its icon (or picture if defined).

Figure 4.34: Selected Venue and Courses As can be seen in the list on the left, the course(s) under the Default category are the courses which hold in the selected venue. To add a course to the selected venue, a course is selected from any other level category and right-clicked which results in a context menu

. Figure 4.35: Adding Courses to a Selected Venue The Add menu item can be used to define the course as holding in the selected venue. It is to be noted that the value in parentheses beside the course identifier is the number of students that have registered that course. The addition of a course with the number of registered students greater than the capacity of the venue will fail. To remove an already attached course, one is selected from the Default group of courses (for the selected venue) and use the Delete menu item. A detailed list of the courses related to a venue is produced by exporting a venue to a HTML page (see appendices).

4.2.2 Period Courses The period course relationship simply put, defines the courses which hold during a particular period. This is a one to many mapping as several courses may be taught in specific periods. To specify this relationship, a period is selected by clicking its icon.

Figure 4.36: Selected Period and Courses As can be seen in the list on the left, the course(s) under the Default category are the courses which hold during the selected period. To add a course to the selected period, a course is selected from any other level category and right-clicked which results in a context menu

. Figure 4.37: Adding Courses to a Selected Period The Add menu item can be used to define the course as holding during the selected period. It is to be noted that the value in parentheses beside the course identifier is the credit unit or the number of hours the course is to be taught in a week. The addition of a course with the number of hours less than the duration of the period will fail. To remove an already attached course, one is selected from the Default group of courses (for the selected period) and use the Delete menu item. 4.2.3 Lecturer Courses The lecturer course relationship simply put, defines the courses a particular lecturer teaches. This is a one to many mapping as several courses may be taught by a specific lecturer. To specify this relationship, a lecturer is selected by clicking the respective icon (or picture if defined).

Figure 4.38: Selected Lecturer and Courses As can be seen in the list on the left, the course(s) under the Default category are the courses which the selected lecturer teaches. To add a course to the selected lecturer, a course is selected from any other level category and right-clicked which results in a context menu

. Figure 4.39: Adding Courses to a Selected Lecturer The Add menu item can be used to define the course as being taught by the selected lecturer. It is to be noted that the value in parentheses beside the course identifier is the credit unit of that course. To remove an already attached course, one is selected from the Default group of courses (for the selected lecturer) and use the Delete menu item. A detailed list of the courses related to a lecturer is produced by exporting a lecturer to a HTML page (see appendix). 4.2.4 Student Courses The student course relationship simply put, defines the courses a particular student has registered. This is a one to many mapping as several courses are registered by a specific student. To specify this relationship, a student is selected by clicking the respective icon (or picture if defined).

Figure 4.40: Selected Student and Courses As can be seen in the list on the left, the course(s) under the Default category are the courses which the selected student has registered. To add a course to the selected student, a course is selected from any other level category and right-clicked which results in a context menu

. Figure 4.41: Adding Courses to a Selected Student The Add menu item can be used to define the course as being registered by the selected student. It is to be noted that the value in parentheses beside the course identifier is the credit unit of that course. The addition of an already registered course to the selected student will fail. To remove an already attached course, one is selected from the Default group of courses (for the selected student) and use the Delete menu item. A detailed list of the courses related to a student is produced by exporting a student to a HTML page (see appendix). 4.2.5 Timetable Periods The timetable period relationship simply put, defines the periods a specific timetable manages. This is obviously a one to many mapping as a timetable definitely manages more than one period. This relationship is created when a timetable is created. During the timetable creation, all periods existing in the system are assigned to be managed by the timetable.

4.3 Iteration The iteration processes which reduces the number of infringements or clashes in a timetable is the key factor which differentiates this program from the manual process. The iteration process for the timetable only begins after other independent objects such as venues, periods and the like have been defined. Also relationships between these independent objects have to be created thereby tying all items of the timetable together. Lecturers have to be assigned courses, students linked with their registered courses, courses specified to be taught at venues and courses assigned to desired periods of the day. The assignment of courses to periods is the seeding of the timetable generator. A timetable has to be created first, no matter how inefficient or fraught with infringements or clashes. The generator even has the capability to work with a timetable whose courses are spread over a single day. It will then find the most efficient combination of courses and periods by moving some courses to other periods. In the creation of a sample, student registration for 300, 400 and 500 levels for the first semester of the 2009/2010 session was used. Randomly assigning these courses to periods with no thought to clashes resulted in the following timetables. Note that the timetables are filtered by course level.

Figure 4.42: EEE Lecture timetable for 300 level

Figure 4.43: EEE Lecture timetable for 400 level

Figure 4.44: EEE Lecture timetable for 500 level As would be noticed, each period start-time is specified with the value after the asterix (*) representing the number of hours through which the course will hold.

Figure 4.45: Timetable periods and courses The selected icon in the list of timetables represents the timetable identifier and the iteration number.

Figure 4.46: Timetable ID and iteration The figure after the colon is the iteration number of the timetable. It is zero in this case meaning that the timetable has just been seeded and there has been no attempt to perform iterations on it to make it more efficient. The infringement panel as shown below displays several indicators of the efficiency of the timetable generated.

Figure 4.47: Timetable infringement panel The first indicator represents the number of courses in the generator system which have not been used in the generation of the timetable. A zero value means all courses have been used. This is the desired value for this indicator as shown by the tick. The second indicator (for venue) shows the number of clashes in venue present in the timetable. The third and the fourth indicators respectively, represent the lecturer and student infringements present in the timetable selected.

In the case of an infringement, iterating the timetable in the context of the indicator reduces or completely eliminates such infringement.

Figure 4.48: Timetable infringement iteration The iteration of the timetable to reduce the venue infringement results in a new timetable. This timetable is an improvement over the previous as it offers a lower infringement value for venue.

Figure 4.49: Timetable derived by venue iteration As can be seen from the figure above, a new timetable has been created by an iteration of the old under the venue context. After a single iteration, a timetable with the following indicator was the result.

Figure 4.50: Timetable infringement panel after iteration

The venue indicator now has a zero value which shows that no two courses are holding at the same period in the same venue. Iterations under contexts with infringement values greater than zero are repeated until the best possible timetable is obtained.

Figure 4.51: Timetable infringement panel after 8 iterations The best possible timetable was obtained after 8 timetable iterations with each step taking no more than the iteration maximum value of 5 trials which is the default setting for the generator. The above iteration has been modelled based on a normal semester course schedule. For an examination scenario which is no different from a normal timetable, non repeating periods (with defined dates) are used when the timetable created has been specified as examination with the use of the examination radio button.

Figure 4.52: Specifying timetable type The same processes where carried out on an examination timetable which was seeded with all 300, 400 and 500 level courses.

Figure 4.53: Examination timetable The infringement panel of the above timetable which is shown below has the course indicator flagged with a value of 3. This is due to three courses for which exams are not written which include the 500 level Project A (EEE 599A), 400 level Practical and Mini Project (EEE 491) and 300 level Engineering Laboratories (EGL 311).

Figure 4.54: Examination timetable infringement panel Further iteration in the student context results in a more efficient timetable. After 8 iterations, the infringement panel is as shown below

Figure 4.55: Examination timetable infringement panel after 8 iterations

You might also like