CPU Scheduling Interface#13871
CPU Scheduling Interface#13871shashwat-126 wants to merge 3 commits intoTheAlgorithms:masterfrom shashwat-126:master
Conversation
There was a problem hiding this comment.
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 | ||
| yield (t, None, []) | ||
| continue | ||
| process = min(ready, key=lambda x: x["burst"]) |
There was a problem hiding this comment.
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]], None, None]: |
There was a problem hiding this comment.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.py, please provide doctest for the function _simulate_sjf_p
| t += 1 | ||
| yield (t, None, []) | ||
| continue | ||
| process = min(ready, key=lambda x: x["remaining"]) |
There was a problem hiding this comment.
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]], None, None]: |
There was a problem hiding this comment.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.py, please provide doctest for the function _simulate_priority_np
| t += 1 | ||
| yield (t, None, []) | ||
| continue | ||
| process = min(ready, key=lambda x: x["priority"]) |
There was a problem hiding this comment.
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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.py, please provide doctest for the function show_results
There was a problem hiding this comment.
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 | ||
| yield (t, None, []) | ||
| continue | ||
| process = min(ready, key=lambda x: x["burst"]) |
There was a problem hiding this comment.
Please provide descriptive name for the parameter: x
| done += 1 | ||
|
|
||
| # shortest job first preemptive | ||
| def _simulate_sjf_p( |
There was a problem hiding this comment.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.py, please provide doctest for the function _simulate_sjf_p
| t += 1 | ||
| yield (t, None, []) | ||
| continue | ||
| process = min(ready, key=lambda x: x["remaining"]) |
There was a problem hiding this comment.
Please provide descriptive name for the parameter: x
| t += 1 | ||
|
|
||
| # priority non preemptive | ||
| def _simulate_priority_np( |
There was a problem hiding this comment.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.py, please provide doctest for the function _simulate_priority_np
| t += 1 | ||
| yield (t, None, []) | ||
| continue | ||
| process = min(ready, key=lambda x: x["priority"]) |
There was a problem hiding this comment.
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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.py, please provide doctest for the function show_results
There was a problem hiding this comment.
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 | ||
| yield (t, None, []) | ||
| continue | ||
| process = min(ready, key=lambda x: x["burst"]) |
There was a problem hiding this comment.
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]], None, None]: |
There was a problem hiding this comment.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.py, please provide doctest for the function _simulate_sjf_p
| t += 1 | ||
| yield (t, None, []) | ||
| continue | ||
| process = min(ready, key=lambda x: x["remaining"]) |
There was a problem hiding this comment.
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]], None, None]: |
There was a problem hiding this comment.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.py, please provide doctest for the function _simulate_priority_np
| t += 1 | ||
| yield (t, None, []) | ||
| continue | ||
| process = min(ready, key=lambda x: x["priority"]) |
There was a problem hiding this comment.
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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.py, please provide doctest for the function show_results
There was a problem hiding this comment.
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 | ||
| yield (t, None, []) | ||
| continue | ||
| process = min(ready, key=lambda x: x["burst"]) |
There was a problem hiding this comment.
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]], None, None]: |
There was a problem hiding this comment.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.py, please provide doctest for the function _simulate_sjf_p
| t += 1 | ||
| yield (t, None, []) | ||
| continue | ||
| process = min(ready, key=lambda x: x["remaining"]) |
There was a problem hiding this comment.
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]], None, None]: |
There was a problem hiding this comment.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.py, please provide doctest for the function _simulate_priority_np
| t += 1 | ||
| yield (t, None, []) | ||
| continue | ||
| process = min(ready, key=lambda x: x["priority"]) |
There was a problem hiding this comment.
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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.py, please provide doctest for the function show_results
There was a problem hiding this comment.
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 | ||
| yield (t, None, []) | ||
| continue | ||
| process = min(ready, key=lambda x: x["burst"]) |
There was a problem hiding this comment.
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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.py, please provide doctest for the function _simulate_sjf_p
| t += 1 | ||
| yield (t, None, []) | ||
| continue | ||
| process = min(ready, key=lambda x: x["remaining"]) |
There was a problem hiding this comment.
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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.py, please provide doctest for the function _simulate_priority_np
| t += 1 | ||
| yield (t, None, []) | ||
| continue | ||
| process = min(ready, key=lambda x: x["priority"]) |
There was a problem hiding this comment.
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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.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.
As there is no test file in this pull request nor any test function or class in the file scheduling/cpu_scheduling_interface.py, please provide doctest for the function show_results
for more information, see https://pre-commit.ci
Describe your change:
CPU Scheduling Algorithm with user interface with custom inputs, it includes First come First serve, Shortest job first, Round Robin, Priority .
Checklist: