sgpemv2/src/builtin-policies/fcfs.py

23 lines
480 B
Python
Raw Normal View History

from Policy import Policy
import sys
class fcfs(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_schedulable().get_arrival_time() < \
b.get_schedulable().get_arrival_time()
self.sort(queue,cmpf)