-
Notifications
You must be signed in to change notification settings - Fork 4
Refactor main #49
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
base: main
Are you sure you want to change the base?
Refactor main #49
Changes from all commits
1c6a839
d34c262
cc439e2
5584ad3
34a612d
3630f62
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,7 @@ class ClassroomTimetable: | |
| def __init__(self): | ||
| # Dictionary to hold timetables for each classroom | ||
| self.classroom_timetable = {} | ||
|
|
||
| def generate_classroom_timetable(self, chromosome): | ||
| for week, days in chromosome.items(): | ||
| for day, sections in days.items(): | ||
|
|
@@ -35,14 +35,14 @@ def save_timetable_to_json(self, file_path="Constants/classroom_timetable.json") | |
| except Exception as e: | ||
| print(f"Error saving timetable to '{file_path}': {e}") | ||
|
|
||
| if __name__ == "__main__": | ||
| # Generate classroom-wise timetable | ||
| classroom_timetable = ClassroomTimetable() | ||
| w = { | ||
| "Week 2": SampleChromosome.schedule2, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This main function was taking chromosome from samples.py and if only the above function will be called then only a json format will be send |
||
| "Week 1": SampleChromosome.schedule1 | ||
| } | ||
| classroom_tt = classroom_timetable.generate_classroom_timetable(w) | ||
| print(classroom_tt) | ||
| # Save as JSON | ||
| classroom_timetable.save_timetable_to_json() | ||
| # if __name__ == "__main__": | ||
| # # Generate classroom-wise timetable | ||
| # classroom_timetable = ClassroomTimetable() | ||
| # w = { | ||
| # "Week 2": SampleChromosome.schedule2, | ||
| # "Week 1": SampleChromosome.schedule1 | ||
| # } | ||
| # classroom_tt = classroom_timetable.generate_classroom_timetable(w) | ||
| # print(classroom_tt) | ||
| # # Save as JSON | ||
| # classroom_timetable.save_timetable_to_json() | ||
This file was deleted.
This file was deleted.
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.
?
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.
This is for each classroom timetable and also this will be used for making timetable for the labs