sgpemv2/src/builtin-policies/sjf.py

22 lines
444 B
Python
Raw Normal View History

from Policy import Policy
import sys
class sjf(Policy) :
def __init__(self):
pass;
def configure(self):
print 'No options to configure for fcfs'
def is_preemptive(self):
return False
def get_time_slice(self):
return -1
def sort_queue(self, event, queue):
cmpf = lambda a, b: \
a.get_cpu_time_left() < \
b.get_cpu_time_left()
self.sort(queue,cmpf)