Commit 4926f72e authored by Georgios Dagkakis's avatar Georgios Dagkakis

OperatorOperator to be able to be defined statically

parent 0053c151
...@@ -274,6 +274,7 @@ def createObjectInterruptions(): ...@@ -274,6 +274,7 @@ def createObjectInterruptions():
inputDict=dict(element) inputDict=dict(element)
# create the ObjectInterruption # create the ObjectInterruption
objectInterruption=objectType(**inputDict) objectInterruption=objectType(**inputDict)
if not 'OperatorRouter' in str(objectType):
G.ObjectInterruptionList.append(objectInterruption) G.ObjectInterruptionList.append(objectInterruption)
# search inside the nodes for encapsulated ObjectInterruptions (failures etc) # search inside the nodes for encapsulated ObjectInterruptions (failures etc)
...@@ -341,6 +342,8 @@ def createObjectInterruptions(): ...@@ -341,6 +342,8 @@ def createObjectInterruptions():
G.ShiftSchedulerList.append(SS) G.ShiftSchedulerList.append(SS)
# =========================================================================== # ===========================================================================
# creates the entities that are wip # creates the entities that are wip
# =========================================================================== # ===========================================================================
......
...@@ -39,7 +39,7 @@ class Router(ObjectInterruption): ...@@ -39,7 +39,7 @@ class Router(ObjectInterruption):
# The Broker is initiated within the Machine and considered as # The Broker is initiated within the Machine and considered as
# black box for the ManPy end Developer # black box for the ManPy end Developer
# ======================================================================= # =======================================================================
def __init__(self): def __init__(self,id='Router01',name='Router01',**kw):
ObjectInterruption.__init__(self) ObjectInterruption.__init__(self)
self.type = "Router" self.type = "Router"
self.isInitialized=False self.isInitialized=False
...@@ -52,6 +52,8 @@ class Router(ObjectInterruption): ...@@ -52,6 +52,8 @@ class Router(ObjectInterruption):
self.preemptiveOperators=[] # list of preemptiveOperators that should preempt their machines self.preemptiveOperators=[] # list of preemptiveOperators that should preempt their machines
self.criticalQueues=[] self.criticalQueues=[]
self.pending=[] # list of entities that require operators now self.pending=[] # list of entities that require operators now
self.id=id
self.name=name
from Globals import G from Globals import G
G.RouterList.append(self) G.RouterList.append(self)
......
...@@ -42,14 +42,18 @@ class SkilledRouter(Router): ...@@ -42,14 +42,18 @@ class SkilledRouter(Router):
# TODO: we should maybe define a global schedulingRule criterion that will be # TODO: we should maybe define a global schedulingRule criterion that will be
# chosen in case of multiple criteria for different Operators # chosen in case of multiple criteria for different Operators
# ======================================================================= # =======================================================================
def __init__(self,sorting=False, outputSolutions=True): def __init__(self,id='SkilledRouter01',name='SkilledRouter01',sorting=False,outputSolutions=True,
weightFactors=[2, 1, 0, 2, 1, 1], tool={},**kw):
Router.__init__(self) Router.__init__(self)
# Flag used to notify the need for re-allocation of skilled operators to operatorPools # Flag used to notify the need for re-allocation of skilled operators to operatorPools
self.allocation=False self.allocation=False
# Flag used to notify the need to wait for endedLastProcessing signal # Flag used to notify the need to wait for endedLastProcessing signal
waitEndProcess=False waitEndProcess=False
self.outputSolutions=outputSolutions self.outputSolutions=outputSolutions
self.id='SkilledRouter01' self.id=id
self.name=name
self.weightFactors=weightFactors
self.tool=tool
#=========================================================================== #===========================================================================
# the initialize method # the initialize method
...@@ -163,7 +167,8 @@ class SkilledRouter(Router): ...@@ -163,7 +167,8 @@ class SkilledRouter(Router):
# as it doesn't support zero WIP levels # as it doesn't support zero WIP levels
#=================================================================== #===================================================================
solution=opAss_LP(self.availableStationsDict, self.availableOperatorList, solution=opAss_LP(self.availableStationsDict, self.availableOperatorList,
self.operators, previousAssignment=self.previousSolution) self.operators, previousAssignment=self.previousSolution,
weightFactors=self.weightFactors,Tool=self.tool)
# print '-------' # print '-------'
# print self.env.now, solution # print self.env.now, solution
......
...@@ -15,7 +15,6 @@ def opAss_LP(machineList, PBlist, PBskills, previousAssignment={}, weightFactors ...@@ -15,7 +15,6 @@ def opAss_LP(machineList, PBlist, PBskills, previousAssignment={}, weightFactors
from Globals import G from Globals import G
startPulp=time.time() startPulp=time.time()
machines = machineList.keys() machines = machineList.keys()
sumWIP = float(sum([machineList[mach]['WIP'] for mach in machines ])) sumWIP = float(sum([machineList[mach]['WIP'] for mach in machines ]))
......
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