Skip to content

Some useful functions

framinan edited this page Feb 16, 2022 · 5 revisions

Introduction

scheptk.util contains a number of functions that are useful to develop scheduling models. While some of these functions are intended to be used internally by scheptk, some of them can be useful to build algorithms.

Sorting functions

  • sorted_index_asc(list) yields a list containing the ordered indices of the elements in list. The following code:
from scheptk.util import sorted_index_asc

processing_times = [10,69,5,28,12]
jobs_SPT_order = sorted_index_asc(processing_times)
print(jobs_SPT_order)

produces the output [2, 0, 4, 3, 1]

Clone this wiki locally