I recently developped a prototype to manage the pairing during a tournament. Here is the problem :
There is N tables, on which on each round, 2 players confront themselves. At the end of each round, every player get points which are added to their global score. The aim here is to minimize the score difference of every set of 2 players to ensure each player to have a suitable opponent and to have a decent ranking at the end of the tournament.
I managed to make the thing works pretty well. I have a PlanningSolution which contains a set a players and a set of tables. A table is a PlanningEntity which contains a PlanningListVariable of players. A player is a PlanningEntity (with a InverseRelationShadowVariable but I don’t think that’s relevant here).
To ensure to have 2 players per table, this is my first hard constraint. My second hard constraint is to avoid 2 players to face each other more than 1 time. Then I have a soft contraint for the score difference between the 2 players.
My question here is : is it relevant to use a PlanningListVariable here ? I didn’t manage to make it work using 2 PlanningVariable (player1 and player2) on the Table entity and I would like to know if I could improve this prototype.
I’m planning to make it available on github once I feel the code is decent enough.
Cheers !
Leff is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.