SchoolTimetable: A hybrid CP and MAS case study
Two types of agents are used to simulate a real scenario: Time-Scheduler and ProfessorTime-Scheduler is responsible for:Description
- creation of timetables
- communication of timetables to each professor
- mediation of negotiation among professors for the satisfaction of their preferences
- receive the timetable
- try to satisfy own preferences
- decide whether to accept a lesson change or not
When a professor wants to change an own lesson in order to satisfy a preference, a call-for-proposal (cfp) message is sent to the time-scheduler to begin the negotiation. The time-scheduler will retrieve the list of all professors who teach in the same class of the proposer’s lesson. To have a reasonable change it is also important to consider that for each candidate professor and for each candidate lesson:Communication
- the proposer must be free during a candidate lesson
- the candidate professor must be free during the lesson the time-scheduler wants to propose
- the proposer’s lesson cannot be in the free day of the candidate professor and the candidate lesson cannot be in the free day of the proposer professor
- the proposed lesson is not one of own preferences
- the lesson to give must not be in the locked preferences If these criteria are met, the candidate professor replies with an agree message otherwise refuses. If the reply message contains agree as performative, the time-scheduler communicates to the proposer the possible change. The proposer will accept or reject according to the fact that the lesson change does not worsen own preferences. According to the last message received from the proposer, the time-scheduler will send to the candidate, who previously accepted the change, a confirm or disconfirm message. If all possible negotiations fail, the time-scheduler will send to the proposer a refuse message.
The project has been developed mainly in Java using the Jade MAS framework. The Constraint Programming model defined to find a feasible timetable for all Professors has been realized with Kotlin language using the following libraries:Framework and Libraries
- 2p-Kt: Prolog interpreter written in Kotlin
- Choco Solver: used to create a library of CP