- Add documentation for classes:
- (C++) PythonPolicyManager - (Python) Policy, ScriptAdapter, fcfs git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@408 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
9091035003
commit
e2211907f5
4 changed files with 188 additions and 34 deletions
|
@ -16,18 +16,18 @@ class fcfs(Policy) :
|
|||
def sort_queue(self, event, queue):
|
||||
print 'Entering sort_queue'
|
||||
print queue.size()
|
||||
print queue.get_item_at(0)
|
||||
print dir(queue.get_item_at(0))
|
||||
for i in range(0, queue.size()):
|
||||
ss = queue.get_item_at(i)
|
||||
print ss.get_schedulable().get_name()
|
||||
cmpf = lambda a, b: \
|
||||
a.get_schedulable().get_arrival_time() < \
|
||||
b.get_schedulable().get_arrival_time()
|
||||
try:
|
||||
self.sort(queue,cmpf)
|
||||
except:
|
||||
print "Unexpected error:", sys.exc_info()[0]
|
||||
raise
|
||||
for i in range(0, queue.size()):
|
||||
ss = queue.get_item_at(i)
|
||||
print ss.get_schedulable().get_name()
|
||||
# Uncomment this to try the qsort algorithm with FCFS
|
||||
#cmpf = lambda a, b: \
|
||||
# a.get_schedulable().get_arrival_time() < \
|
||||
# b.get_schedulable().get_arrival_time()
|
||||
#try:
|
||||
# self.sort(queue,cmpf)
|
||||
#except:
|
||||
# print "Unexpected error:", sys.exc_info()[0]
|
||||
# raise
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue