TODOs added

parent d86425de
...@@ -104,6 +104,7 @@ class OperatorPreemptive(Operator): ...@@ -104,6 +104,7 @@ class OperatorPreemptive(Operator):
# ======================================================================= # =======================================================================
# override the default method so that Entities # override the default method so that Entities
# that are critical got served first # that are critical got served first
# TODO: NOT USED!
# ======================================================================= # =======================================================================
def sortEntities(self): def sortEntities(self):
Operator.sortEntities(self) #do the default sorting first Operator.sortEntities(self) #do the default sorting first
......
...@@ -49,8 +49,8 @@ class Router(ObjectInterruption): ...@@ -49,8 +49,8 @@ class Router(ObjectInterruption):
# list that holds all the objects that can receive # list that holds all the objects that can receive
self.pendingObjects=[] self.pendingObjects=[]
self.calledOperators=[] self.calledOperators=[]
# TODO: consider if there must be an argument set for the schedulingRules of the Router # # TODO: consider if there must be an argument set for the schedulingRules of the Router
self.schedulingRule='' # self.schedulingRule=''
# list of the operators that may handle a machine at the current simulation time # list of the operators that may handle a machine at the current simulation time
self.candidateOperators=[] self.candidateOperators=[]
# list of criteria # list of criteria
...@@ -399,12 +399,14 @@ class Router(ObjectInterruption): ...@@ -399,12 +399,14 @@ class Router(ObjectInterruption):
# if there operators that have only one option then sort the candidateOperators according to the first one of these # if there operators that have only one option then sort the candidateOperators according to the first one of these
# TODO: find out what happens if there are many operators with one option # TODO: find out what happens if there are many operators with one option
# TODO: incorporate that to sortOperators() method # TODO: incorporate that to
# self.sortOperators()
# sort the operators according to their waiting time # sort the operators according to their waiting time
self.candidateOperators.sort(key=lambda x: x.totalWorkingTime) self.candidateOperators.sort(key=lambda x: x.totalWorkingTime)
# sort according to the number of options
if operatorsWithOneOption: if operatorsWithOneOption:
self.candidateOperators.sort(key=lambda x: x in operatorsWithOneOption, reverse=True) # sort according to the number of options self.candidateOperators.sort(key=lambda x: x in operatorsWithOneOption, reverse=True)
#======================================================================= #=======================================================================
# Find candidate entities and their receivers # Find candidate entities and their receivers
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment