daffidwilde / matching

A package for solving matching games
https://daffidwilde.github.io/matching/
MIT License
150 stars 42 forks source link

Generalise post-solve checks #119

Closed daffidwilde closed 4 years ago

daffidwilde commented 4 years ago

Rather than have duplicate and largely equivalent methods in each game, this PR generalises the matching validation process.

Now each base player class (Player and Hospital) has their own methods for checking their match(es). These methods make use of the MatchingError exception -- which has also been generalised.

Likewise, each base game (StableRoommates, StableMarriage, HospitalResident) has its own methods for checking their players.