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

OperatorOperator to be able to be defined statically

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