Skip to content
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

implement duplicate schedule checking in schedule generator #974

Open
wants to merge 6 commits into
base: schedule_gen_revamp
Choose a base branch
from

Conversation

ejcheng
Copy link
Member

@ejcheng ejcheng commented Dec 10, 2024

Summary

This is a WIP PR implementing duplicate checking for schedules in the CoursePlan schedule generator.

Problems, todos, and future considerations:

  • Course time slots are not correct for Spring '25
  • Need to add discussion/lab times
  • Need a better algorithm than the current randomization one— my current approach with manually timing out the generation after 1 second isn't very optimal
  • Update pagination bounds when number of possible schedules is less than 5

@ejcheng ejcheng self-assigned this Dec 10, 2024
@ejcheng ejcheng requested a review from a team as a code owner December 10, 2024 22:34
@dti-github-bot
Copy link
Member

dti-github-bot commented Dec 10, 2024

[diff-counting] Significant lines: 51.

@ejcheng ejcheng marked this pull request as draft December 10, 2024 22:34
Copy link
Contributor

github-actions bot commented Dec 10, 2024

Visit the preview URL for this PR (updated for commit dbca27e):

https://cornelldti-courseplan-dev--pr974-remove-schedule-gen-ssinnx1g.web.app

(expires Thu, 06 Mar 2025 19:34:08 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 6d4e0437c4559ed895272bbd63991394f1e0e933

@ejcheng
Copy link
Member Author

ejcheng commented Feb 4, 2025

@ejcheng ejcheng changed the title WIP: implement duplicate schedule checking in schedule generator implement duplicate schedule checking in schedule generator Feb 7, 2025
@ejcheng ejcheng marked this pull request as ready for review February 7, 2025 17:42
@@ -118,6 +130,7 @@ import Course, {
Timeslot,
} from '@/schedule-generator/course-unit';
import Requirement from '@/schedule-generator/requirement';
import _ from 'lodash';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should move this line between line 120 and 121.

return false;
}
const firstScheduleEntries = Array.from(first.schedule.entries());
const secondScheduleEntries = Array.from(first.schedule.entries());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe there's a slight bug. It should be const secondScheduleEntries = Array.from(first.schedule.entries()); , or else you're just comparing the same entries from first, then this function always returns True. Let me know if that's not the case though!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can also add a length check to return false early aswell.

Copy link
Contributor

@plumshum plumshum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Eric. I left a few comments for this PR. I believe there is a slight bug for isEqual. Also, I think we should discuss how many pages we want the scheduler generator to output, because if we have more than 10+ pages, that might be too much for the user. But I also agree that we shouldn't always produce 5 pages. Good job!

@ejcheng ejcheng changed the base branch from main to schedule_gen_revamp February 13, 2025 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants