-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #318 from appKom/314-refaktorer-matching-algoritmen
Fikser tildeling av samme rom ved parallelle intervjuer
- Loading branch information
Showing
9 changed files
with
110 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
""" | ||
Typealiaser | ||
""" | ||
|
||
from typing import TypedDict, TYPE_CHECKING | ||
import mip | ||
if TYPE_CHECKING: | ||
# Unngår cyclic import | ||
from mip_matching.Applicant import Applicant | ||
from mip_matching.Committee import Committee | ||
from mip_matching.TimeInterval import TimeInterval | ||
|
||
|
||
type Room = str | ||
type Matching = tuple[Applicant, Committee, TimeInterval, Room] | ||
|
||
class MeetingMatch(TypedDict): | ||
"""Type definition of a meeting match object""" | ||
solver_status: mip.OptimizationStatus | ||
matched_meetings: int | ||
total_wanted_meetings: int | ||
matchings: list[Matching] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,14 @@ | ||
from __future__ import annotations | ||
from datetime import datetime, timedelta | ||
import unittest | ||
from mip_matching.TimeInterval import TimeInterval | ||
from mip_matching.Committee import Committee | ||
# from __future__ import annotations | ||
# from datetime import datetime, timedelta | ||
# import unittest | ||
# from mip_matching.TimeInterval import TimeInterval | ||
# from mip_matching.Committee import Committee | ||
|
||
|
||
class ApplicantTest(unittest.TestCase): | ||
def setUp(self) -> None: | ||
self.committee = Committee( | ||
"TestKom", interview_length=timedelta(minutes=30)) | ||
self.committee.add_intervals_with_capacities({ | ||
TimeInterval(datetime(2024, 8, 24, 8, 0), datetime(2024, 8, 24, 9, 30)): 1, | ||
TimeInterval(datetime(2024, 8, 24, 8, 30), datetime(2024, 8, 24, 9, 30)): 1 | ||
}) | ||
# class ApplicantTest(unittest.TestCase): | ||
# def setUp(self) -> None: | ||
# self.committee = Committee( | ||
# "TestKom", interview_length=timedelta(minutes=30)) | ||
|
||
|
||
def test_capacity_stacking(self) -> None: | ||
self.assertEqual(1, self.committee.get_capacity( | ||
TimeInterval(datetime(2024, 8, 24, 8, 0), datetime(2024, 8, 24, 8, 30)))) | ||
self.assertEqual(2, self.committee.get_capacity( | ||
TimeInterval(datetime(2024, 8, 24, 8, 30), datetime(2024, 8, 24, 9, 0)))) | ||
|
Oops, something went wrong.