COMP2432 Group Project (2022/2023 Semester 2)
Project title: APpointment Organizer (APO)
Nowadays, people are always busy. There are dates, meetings, gatherings and many other events and activities that have to be made and arranged. In order to avoid conflicts, people need a good assistant application to record and arrange those appointments, e.g. using PDA or phone organizer. In the Department of Computing, students John, Lucy, Mary and Paul are good friends and have formed a study group. They always have gatherings and other activities on the campus. However, due to the condensed classes and time tables in this semester, the gatherings cannot be arranged properly in most of the time. They have to check with one another for the availability of timeslots when they want to confirm with an appointment. It is very time-consuming and inefficient to make appointments in this “manual” approach. Knowing that you have learnt process scheduling from the subject COMP2432; maybe you can give them a hand to simplify their appointment bookings and organization problems. Furthermore, in future, you might want to further develop this APO and deploy within their mobile phones to carry out such scheduling and organizing functionalities, if you are interested.
In this project, you will be given an opportunity to apply the theory of process scheduling you have learnt from COMP2432 to a daily-life scenario and produce the APpointment Organizer (APO). In general, APO may be designed with different modules with different functionalities. As a default arrangement, this project may be developed in five stages in the form of five parts (or up to six parts):
Part 1. Write a program that allows users to add details of appointment (date, time, duration, and/or callees) to the scheduler. Note that the one who initiates for the appointment is called the “user” or the “caller” and those other members involved in the appointment are called “callees”, making use of the terms in procedure call within a program. This program is referred to as the Input Module. Bear in mind that this application should allow batch input, i.e. reading in from files for data entries. It is recommended to store all meeting requests in a log file for future audit purpose (and in your case, debugging purpose). By the way, the application is developed to be used internally for the time being. If the result is satisfactory, you may consider promoting it to the public to use the application, e.g. publish it under Google Play.
Part 2. APO checks whether the timeslot(s) of the involved parties are available or reserved. That is, not only the user’s timeslot(s), but also those of the callees’, if any, would be checked 1 . APO sends messages to all callees to check for their availability and callees should reply the message no matter the timeslot(s) are available or not. If all parties are available, the appointment should be then confirmed2. Otherwise, the appointment would be rejected or rescheduled3. For example, consider the scenario that Paul calls for a meeting with Lucy and Mary. APO checks not only for Paul’s schedule but also the schedules of Lucy and Mary. The appointment would be accepted and confirmed only when all of them are available. Otherwise, the appointment would be rejected or rescheduled. Here, “rescheduling” is a bonus option. This appointment information should be reflected within the time table generated (see printSchd below under Implementation section) by all the users involved. Part 3. Extend the program developed in Part 2 with a scheduler to generate a timetable for all appointments (i.e. timeslots engaged or available). The scheduler might implement several scheduling algorithms similar to those covered in lecture 6. (In this project, you are asked to implement at least two. One of them should be the relatively straightforward First Come First Served.) This is called the Scheduling Kernel, within the Scheduling Module. That is the module to include all the scheduling algorithms that you have implemented. Part 4. Augment the program with the facilities to print appointment schedule for users in Part 2. Those rejected appointments should all be included and recorded in an output file, named “rejected.dat”. This constitutes the Output Module.
Part 5. Analyze the program with different scheduling methods for which you have tested. List out those advantages and disadvantages which can be read from the program implemented. Part 6. (Bonus up to 5%) Implement the automatic rescheduling algorithm(s) and discuss on the advantages and disadvantages of your rescheduling algorithm(s). You must form a group of 4 to 5 persons for the project. The project must be implemented using programming language C and it must be successfully executed on ANY ONE of Linux Servers (apollo or apollo2) in the Department of Computing. You will have to specify to us on which Linux server your project would be executed for our testing. Note that “gcc” or “cc” is the compiler that can be used in this project.
First of all, your program should provide a menu to allow the user to input appointments or command for the organizer. There are several input methods to be accepted by the system. The system should also show whether the appointment is accepted or rejected (print the reason if possible). Below is an example of some inputs and outputs as seen on a screen.
./apo 20230401 20230430 john mary lucy paul ~~WELCOME TO APO~~ Please enter appointment: privateTime paul 20230401 1800 2.0 -> [Recorded] Please enter appointment: privateTime mary 20230402 2000 3.0 -> [Recorded] Please enter appointment: projectMeeting john 20230402 1900 2.0 paul mary -> [Recorded] Please enter appointment: groupStudy paul 20230403 1800 2.0 john lucy -> [Recorded] Please enter appointment: gathering lucy 20230404 1900 4.0 john paul mary -> [Recorded] … … Please enter appointment: printSchd FCFS -> [Exported file: Ggg_01_FCFS.txt] … … Please enter appointment: printSchd PRIORITY -> [Exported file: Ggg_08_PRIORITY.txt] Please enter appointment: projectMeeting john 20230429 2000 2.0 lucy mary -> [Recorded] … … Please enter appointment: printSchd ALL -> [Exported file: Ggg_99_ALL.txt] Please enter appointment: endProgram -> Bye!
Command Syntax and Usage
To execute the program Syntax
./apo YYYYMMDD YYYYMMDD u1 u2 u3 … e.g. ./apo 20230401 20230430 john mary lucy paul
Enter [./apo] to start the program where [YYYYMMDD] x 2 and [u1 u2 u3 …] are Start Date and End Date, and the Users of the application respectively. For example, APO will manage requests starting from April 1, 2023 (20230401) and ending at April 30, 2023 (20230430). In addition, [john mary lucy paul], are the users in this application.
Note: This is the first instruction or command that should have been executed before the application could accept user requests and schedule those appointments. There are at least three users and the maximum number is ten. The system should return an error message if the number of users is not in the range 3 to 10. In addition, you need to convert the names to the standard format (i.e., first letter capitalized regardless of the input string) for all outputs.
For the time being, APO simply manage the timeslots from 18:00 to 23:00 and it is one hour one timeslot. In the other words, there are five timeslots per day. Upon further development, APO may have half hour as one timeslot.
privateTime uuu YYYYMMDD hhmm n.n e.g. privateTime paul 20230401 1800 2.0
It is to add private time into a user’s time table. As in the example, it is to add a private time session for [Paul] on [April 1, 2023] starting at [18:00] and the duration is [2.0] hours. [uuu] – Caller [YYYYMMDD hhmm] – Date and time of the event, YYYY:Year (4 digits), MM:Month (2 digits), DD:Day (2 digits), hh:Hour (2 digits) and mm:Minute (2 digits). [n.n] – Duration of the appointment in hours (fixed point of one decimal place)
This ends the program completely, upon collecting all the child processes and closing all the files.
To ease your work, we make the following assumptions:
- Input formats simply follow those in the examples.
- We will test the schedule for a period, from 1 to 31 May 2023 and the time is from 18:00 to 23:00. One time slot is an hour of time. That means there are 5 time slots a day. In addition, there is no appointment to be assigned on Sunday and Public Holiday.
- There are at least three users and at most ten.
- Usually, a “privateTime” entry has the highest priority and then it is a “projectMeeting”. The next one is “groupStudy”. The lowest one is “gathering”. If the APO applies “priority” as the scheduling algorithm, that priority information for appointments would be considered. For example, a project meeting may “displace” an already scheduled gathering so that the caller/callee involved would attend the meeting and the gathering would be canceled (or rescheduled).
- There are many implementation methods for the modules. The scheduler module may be implemented as a separate process, in the form of a child process created by the parent via fork() system call. The output module can also be a separate process. The scheduler may also be implemented as a separate program. If the parent is passing appointment details to a child scheduler, one should use the pipe() and associated write() / read() system calls. If the parent is passing information to a separate scheduler program, one could use the Unix shell “pipe” (denoted by “|”).
- If pipe() and fork() system calls are both used properly in the program, the maximum possible mark is 100% plus up to 5% of bonus points. On the other hand, if both system calls are not used in the program, only a passing mark would be awarded at best. Intermediate scoring will be given if only one system call is used, depending on the extent of usage.
The “appointment schedule” and the “rejected list” may look like the following. Of course, you may have your own design for this report.
Period: 2023-04-01 to 2023-04-30 Algorithm used: FCFS ***Appointment Schedule*** . John, you have 999 appointments. Date Start End Type People ========================================================================= 2023-04-02 19:00 21:00 Project Meeting 2023-04-04 19:00 23:00 Gathering Mary Paul … … - End of John’s Schedule ========================================================================= Paul, you have 999 appointments. Date Start End Type People ========================================================================= 2023-04-01 18:00 20:00 Private Time 2023-04-04 19:00 23:00 Gathering John Mary … … - End of Paul’s Schedule ========================================================================= … … … … - End of Lucy’s Schedule ========================================================================= … … … … - End of Mary’s Schedule ========================================================================= ......
Although the program does not need to check for the correctness of the values that users input, some other error handling features are required in the application. For example, if the number of users is out of range (not between 3 and 10), APO should return a message to indicate that.
Apart from the above program implementation, you are also required to write a project report that consists of following parts: