I'd like to know whether the following is expected behaviour. Using the HospitalResident algorithm, I have the scenario below. All hospitals rank all residents. The hospitals do not have enough capacity, though: there are 8 residents and only 6 spots.
When using the optimal="resident" option, the algorithm succeeds and says that residents S3 and S1 were not placed — which is expected.
Using the optimal="hospital" option, however, an exception is raised:
File "<...snip...>\Lib\site-packages\matching\algorithms\hospital_resident.py", line 141, in hospital_optimal
successors = resident.get_successors()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "<...snip...>\Lib\site-packages\matching\players\player.py", line 52, in get_successors
idx = self.prefs.index(self.matching)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: H2 is not in list
Hi there! Thanks for this great library.
I'd like to know whether the following is expected behaviour. Using the HospitalResident algorithm, I have the scenario below. All hospitals rank all residents. The hospitals do not have enough capacity, though: there are 8 residents and only 6 spots.
When using the
optimal="resident"
option, the algorithm succeeds and says that residentsS3
andS1
were not placed — which is expected.Using the
optimal="hospital"
option, however, an exception is raised:The code is as follows: