-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Find optimal interview slot #1271
base: master
Are you sure you want to change the base?
Conversation
…at each position. Interviewer cannot be applicant on the same position.
frontend/src/PagesAdmin/RecruitmentPositionOverviewPage/RecruitmentPositionOverviewPage.tsx
Outdated
Show resolved
Hide resolved
backend/root/management/commands/seed_scripts/recruitment_position_interviewers.py
Outdated
Show resolved
Hide resolved
backend/samfundet/utils.py
Outdated
return True | ||
|
||
|
||
def mark_applicant_unavailable(applicant, start_dt, end_dt, buffer_hours=2): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dette blir feil bruk av OccupiedTimeslot. Modellen er ment for brukerens egen utilgjengelighet uavhengig av opptaket. Systemet burde hente brukerens intervjuer automatisk istedenfor dette.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
henter intervjuer, så done
) # Return True if the interviewer is available | ||
|
||
|
||
def mark_interviewers_unavailable(interviewers: list[Any], start_dt: datetime, end_dt: datetime, unavailability: defaultdict[Any, list]) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
list any?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done?
return block_interview_count | ||
|
||
|
||
def allocate_single_interview(current_time, block, applications, interviewer_unavailability, position, interview_duration): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
…ed error handling in view. Also renamed some functions to make the code more intuitv
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hadde det ikke bare funket med en greedy algoritme?
UserIdType = int | ||
TimeSlotType = tuple[datetime, datetime] | ||
|
||
UnavailabilityTypeDict = dict[UserIdType, list[TimeSlotType]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop UserIdType and just add a comment
UserIdType = int | |
TimeSlotType = tuple[datetime, datetime] | |
UnavailabilityTypeDict = dict[UserIdType, list[TimeSlotType]] | |
TimeSlotType = tuple[datetime, datetime] | |
# int is user Id | |
UnavailabilityTypeDict = dict[int, list[TimeSlotType]] |
def handle_allocation_error(self, error: InterviewAllocationError, interview_count: int = 0) -> Response: | ||
error_responses = { | ||
NoTimeBlocksAvailableError: ('No available time blocks for interviews.', status.HTTP_400_BAD_REQUEST), | ||
NoApplicationsWithoutInterviewsError: ('No applications without interviews found.', status.HTTP_400_BAD_REQUEST), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really an error. If there's nothing to do, we're good
make a post request to http://localhost:8000/allocate-interviews/{positionId}/ for a position where there are some applications, with interviewers and applicants available at least 24h in the future.
allocate interviews to blocks with the highest rating first
Plan for optimization
Rating will be based on 1) the number of available interviewers in the block, 2) num. of available interviewers in the preceding and succeeding blocks (if any), as well as 3) the time-length of the block.
Weighting of these factors will be important.
Demonstration:
Interviewers report unavailability in 30 min slots. From this availability is derived, and further time blocks are created which are differentiated by the count of interviewers available in the block.
In this system interviews would be allocated to the highest rated block first. As the blocks are filled the next highest rated block will be allocated interviews.
It is shown in the image bellow that the block at 20:00 to 20:30 where 4 interviewers are available would be filled before the block from 17:30 to 19:00, also where 4 interviewers are available.
This is because the first mentioned block is squeezed between two highly rated blocks.
The weighting and calculation can probably be adjusted for a more ergonomic interview schedule, but this is the gist of interview time blocks.
Showing time block rating calculation
Mail fra ISFiT:
#1134