Skip to content

Commit

Permalink
Implement student-project allocation problem (#39)
Browse files Browse the repository at this point in the history
* Update SA player tests.

* Update SA players to link capacity, etc

* Write tests for SA algorithm and solver init

* Start writing SA solver implementation.

* Allow Faculty instances to set their own capacity.

* Bring in the changes to players; relev. variables

* Finish writing basic tests for StudentAllocation

* Finish basic source for StudentAllocation

* Drop `project_` from capacities in SA tests.

* Implement input check functions for SA (#40)

* Drop `project_` from capacities in SA tests.

* Implement student preference validity check

* Implement faculty preference validity check

* Implement project preference validity check

* Implement faculty capacity check

* Add project capacity check

* Final changes to SA input checks (#41)

* Drop `project_` from capacities in SA tests.

* Implement student preference validity check

* Implement faculty preference validity check

* Implement project preference validity check

* Implement faculty capacity check

* Add project capacity check

* Update HR solver test docstring

* Write tests for validity and stability.

* Update test style in HR solver.

* Write validity/stability source code.

* Move to `matching.matching.Matching` in docstrings.

* Format codebase.

* Move to `Supervisor` from `Faculty`.
  • Loading branch information
daffidwilde committed May 3, 2019
1 parent b928815 commit 06775c7
Show file tree
Hide file tree
Showing 16 changed files with 1,112 additions and 219 deletions.
2 changes: 1 addition & 1 deletion src/matching/games/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

from .hospital_resident import HospitalResident, hospital_resident
from .stable_marriage import StableMarriage, stable_marriage
from .student_allocation import StudentAllocation
from .student_allocation import StudentAllocation, student_allocation
5 changes: 2 additions & 3 deletions src/matching/games/hospital_resident.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class HospitalResident(Game):
Attributes
==========
matching : `Matching` (`dict`-like)
matching : `matching.matching.Matching`
Once the game is solved, a matching is available as a `Matching` object.
This resembles and behaves much like a standard Python dictionary that
uses the hospitals as keys and their resident matches as values.
Expand All @@ -39,11 +39,10 @@ def __init__(self, residents, hospitals):

self.residents = residents
self.hospitals = hospitals
super().__init__()

self._check_inputs()

super().__init__()

def solve(self, optimal="resident"):
""" Solve the instance of HR using either the resident- (resident-) or
hospital- (hospital-) oriented algorithm. Return the matching. """
Expand Down
2 changes: 1 addition & 1 deletion src/matching/games/stable_marriage.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class StableMarriage(Game):
Attributes
==========
matching : `Matching` (`dict`-like)
matching : `matching.matching.Matching`
Once the game is solved, a matching is available. This uses the suitors
and reviewers as keys and values, respectively, in a `Matching` object;
something that closely resembles a standard Python dictionary.
Expand Down
Loading

0 comments on commit 06775c7

Please sign in to comment.