-
-
Notifications
You must be signed in to change notification settings - Fork 49.2k
CPU Scheduling Algorithm with Interfaces #13885
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: master
Are you sure you want to change the base?
Conversation
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.
Click here to look at the relevant links ⬇️
🔗 Relevant Links
Repository:
Python:
Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.
algorithms-keeper commands and options
algorithms-keeper actions can be triggered by commenting on this PR:
@algorithms-keeper reviewto trigger the checks for only added pull request files@algorithms-keeper review-allto trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.
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.
Click here to look at the relevant links ⬇️
🔗 Relevant Links
Repository:
Python:
Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.
algorithms-keeper commands and options
algorithms-keeper actions can be triggered by commenting on this PR:
@algorithms-keeper reviewto trigger the checks for only added pull request files@algorithms-keeper review-allto trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.
scheduling/cpuschedulingalgos.py
Outdated
| t += 1 | ||
| yield (t, None, []) | ||
| continue | ||
| process = min(ready, key=lambda x: x["burst"]) |
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.
Please provide descriptive name for the parameter: x
| done += 1 | ||
|
|
||
| # shortest job first preemptive | ||
| def _simulate_sjf_p(self) -> Generator[tuple[int, str | None, list[str]]]: |
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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpuschedulingalgos.py, please provide doctest for the function _simulate_sjf_p
scheduling/cpuschedulingalgos.py
Outdated
| t += 1 | ||
| yield (t, None, []) | ||
| continue | ||
| process = min(ready, key=lambda x: x["remaining"]) |
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.
Please provide descriptive name for the parameter: x
| t += 1 | ||
|
|
||
| # priority non preemptive | ||
| def _simulate_priority_np(self) -> Generator[tuple[int, str | None, list[str]]]: |
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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpuschedulingalgos.py, please provide doctest for the function _simulate_priority_np
scheduling/cpuschedulingalgos.py
Outdated
| t += 1 | ||
| yield (t, None, []) | ||
| continue | ||
| process = min(ready, key=lambda x: x["priority"]) |
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.
Please provide descriptive name for the parameter: x
| self.avg_label = ttk.Label(self.root, text="", font=("Arial", 11, "bold")) | ||
| self.avg_label.pack() | ||
|
|
||
| def add_process(self) -> 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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpuschedulingalgos.py, please provide doctest for the function add_process
| except ValueError: | ||
| messagebox.showerror("Error", "Invalid input") | ||
|
|
||
| def delete_process(self) -> 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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpuschedulingalgos.py, please provide doctest for the function delete_process
| self.processes = [p for p in self.processes if p["pid"] != pid] | ||
| self.tree.delete(sel[0]) | ||
|
|
||
| def run_scheduling(self) -> 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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpuschedulingalgos.py, please provide doctest for the function run_scheduling
| self.engine = SchedulerEngine(self.processes, algo, quantum) | ||
| threading.Thread(target=self.animate, daemon=True).start() | ||
|
|
||
| def animate(self) -> 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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpuschedulingalgos.py, please provide doctest for the function animate
| time.sleep(0.3) | ||
| self.show_results() | ||
|
|
||
| def show_results(self) -> 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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpuschedulingalgos.py, please provide doctest for the function show_results
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.
Click here to look at the relevant links ⬇️
🔗 Relevant Links
Repository:
Python:
Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.
algorithms-keeper commands and options
algorithms-keeper actions can be triggered by commenting on this PR:
@algorithms-keeper reviewto trigger the checks for only added pull request files@algorithms-keeper review-allto trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.
| t += 1 | ||
|
|
||
| # round robin | ||
| def _simulate_rr(self) -> Generator[tuple[int, str | None, list[str]]]: |
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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpuschedulingalgos.py, please provide doctest for the function _simulate_rr
| process["completion"] = t | ||
| done += 1 | ||
|
|
||
| def _calculate_stats(self) -> 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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpuschedulingalgos.py, please provide doctest for the function _calculate_stats
| self.processes: list[dict] = [] | ||
| self.setup_ui() | ||
|
|
||
| def setup_ui(self) -> 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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpuschedulingalgos.py, please provide doctest for the function setup_ui
for more information, see https://pre-commit.ci
Describe your change:
All CPU Scheduling Algorithm with user interface and user custom inputs with gantt chart, displays waiting, turn around time , avg waiting time and turn around time
Checklist: