kyu_6.scheduling package

Submodules

kyu_6.scheduling.solution module

Test for -> Scheduling (Shortest Job First or SJF).

Created by Egor Kostan. GitHub: https://github.com/ikostan

kyu_6.scheduling.solution.get_min_job(jobs: list) int[source]

Get the smallest job value of jobs that is not equal to 0.

Parameters:

jobs

Returns:

kyu_6.scheduling.solution.shortest_job_first(jobs: list, index: int) int[source]

Shortest Job First or SJF.

It takes in: 1. “jobs” a non-empty array of positive integers. They represent the clock-cycles(cc) needed to finish the job. 2. “index” a positive integer. That represents the job we’re interested in.

SJF returns: 1. A positive integer representing the cc it takes to complete the job at index. :param jobs: :param index: :return:

kyu_6.scheduling.test_solution module

Test for -> Scheduling (Shortest Job First or SJF).

Created by Egor Kostan. GitHub: https://github.com/ikostan

class kyu_6.scheduling.test_solution.SJFTestCase(methodName='runTest')[source]

Bases: TestCase

Testing ‘shortest_job_first’ function.

_classSetupFailed = False
_class_cleanups = []
test_sjf = None
test_sjf_0(**kw)

Testing ‘shortest_job_first’ function with various test data [with n=([100], 0), expected=100].

Returns:

test_sjf_1(**kw)

Testing ‘shortest_job_first’ function with various test data [with n=([3, 10, 20, 1, 2], 0), expected=6].

Returns:

test_sjf_2(**kw)

Testing ‘shortest_job_first’ function with various test data [with n=([3, 10, 20, 1, 2], 1), expected=16].

Returns:

test_sjf_3(**kw)

Testing ‘shortest_job_first’ function with various test data [with n=([3, 10, 10, 20, 1, 2], 1), expected=16].

Returns:

test_sjf_4(**kw)

Testing ‘shortest_job_first’ function with various test data [with n=([3, 10, 10, 20, 1, 2], 2), expected=26].

Returns:

test_sjf_5(**kw)

Testing ‘shortest_job_first’ function with various test data [with n=([20, 20, 7, 15, 14, 10, 16, 16,…, 16, 18, 2, 15, 18, 15, 2], 75), expected=1008].

Returns:

test_sjf_6(**kw)

Testing ‘shortest_job_first’ function with various test data [with n=([4, 13, 13, 12, 17, 4, 15, 4, 1…12, 11, 18, 3, 4, 9, 5, 19], 24), expected=275].

Returns:

Module contents

Scheduling (Shortest Job First or SJF).