Commit 4f239696 authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Georgios Dagkakis

createOpeatorPool corrected + minor updates

parent e088ab7e
...@@ -89,6 +89,8 @@ class Machine(CoreObject): ...@@ -89,6 +89,8 @@ class Machine(CoreObject):
self.MTTF=MTTF self.MTTF=MTTF
self.MTTR=MTTR self.MTTR=MTTR
self.availability=availability self.availability=availability
# check whether the operators are provided with a skills set
self.skilledOperators=self.checkForSkilledOpertors()
# create an operatorPool if needed # create an operatorPool if needed
self.createOperatorPool(operatorPool) self.createOperatorPool(operatorPool)
# holds the Operator currently processing the Machine # holds the Operator currently processing the Machine
...@@ -184,10 +186,6 @@ class Machine(CoreObject): ...@@ -184,10 +186,6 @@ class Machine(CoreObject):
self.preemptQueue=self.env.event() self.preemptQueue=self.env.event()
# signal used for informing objectInterruption objects that the current entity processed has finished processnig # signal used for informing objectInterruption objects that the current entity processed has finished processnig
self.endedLastProcessing=self.env.event() self.endedLastProcessing=self.env.event()
# flag used to inform if the operators assigned to the station are skilled (skillsList)
self.skilledOperators=False
#=========================================================================== #===========================================================================
# create an operatorPool if needed # create an operatorPool if needed
...@@ -199,8 +197,6 @@ class Machine(CoreObject): ...@@ -199,8 +197,6 @@ class Machine(CoreObject):
the list of operators provided the list of operators provided
if the list is empty create operator pool with empty list if the list is empty create operator pool with empty list
''' '''
# flag used to inform if the operators assigned to the station are skilled (skillsList)
self.skilledOperators=False
from Globals import G from Globals import G
# XXX operatorPool is not None ? # XXX operatorPool is not None ?
# if a list of operators is provided as argument # if a list of operators is provided as argument
...@@ -214,18 +210,14 @@ class Machine(CoreObject): ...@@ -214,18 +210,14 @@ class Machine(CoreObject):
self.operatorPool=operatorPool self.operatorPool=operatorPool
# otherwise # otherwise
else: else:
# find out whether the operators are provided a list of skills # if there are operators with skillList
for operator in G.OperatorsList: if self.skilledOperators:
# in that case create an empty operatorPool id = self.id+'_OP'
if operator.skillsList: name=self.objName+'_operatorPool'
id = self.id+'_OP' self.operatorPool=OperatorPool(id,name,operatorsList=[])
name=self.objName+'_operatorPool' G.OperatorPoolsList.append(self.operatorPool)
self.operatorPool=OperatorPool(id,name,operatorsList=[]) # otherwise create no operatorPool
G.OperatorPoolsList.append(self.operatorPool) else:
# and update the flag skilledOperators so whenever the OperatorPool is re-initialised to reset the operators list of the Pool
self.skilledOperators=True
break
if not self.skilledOperators:
self.operatorPool='None' self.operatorPool='None'
# update the operatorPool coreObjects list # update the operatorPool coreObjects list
if self.operatorPool!='None': if self.operatorPool!='None':
...@@ -624,15 +616,14 @@ class Machine(CoreObject): ...@@ -624,15 +616,14 @@ class Machine(CoreObject):
# in case Machine just performed the last work before the scheduled maintenance signal the corresponding object # in case Machine just performed the last work before the scheduled maintenance signal the corresponding object
if self.isWorkingOnTheLast: if self.isWorkingOnTheLast:
# for the scheduled Object interruptions # for the scheduled Object interruptions
# XXX add the SkilledOperatorRouter to this list and perform the signalling only once
for interruption in (G.ShiftSchedulerList+G.ScheduledMaintenanceList): for interruption in (G.ShiftSchedulerList+G.ScheduledMaintenanceList):
# if the objectInterruption is waiting for a a signal # if the objectInterruption is waiting for a a signal
if interruption.victim==self and interruption.waitingSignal: if interruption.victim==self and interruption.waitingSignal:
# signal it and reset the flags # signal it and reset the flags
# interruption.victimEndedLastProcessing.succeed(self.env.now)
self.endedLastProcessing.succeed(self.env.now) self.endedLastProcessing.succeed(self.env.now)
interruption.waitinSignal=False interruption.waitinSignal=False
self.isWorkingOnTheLast=False self.isWorkingOnTheLast=False
# ======================================================================= # =======================================================================
# actions to be carried out when the processing of an Entity ends # actions to be carried out when the processing of an Entity ends
...@@ -884,6 +875,7 @@ class Machine(CoreObject): ...@@ -884,6 +875,7 @@ class Machine(CoreObject):
def releaseOperator(self): def releaseOperator(self):
self.outputTrace(self.currentOperator.objName, "released from "+ self.objName) self.outputTrace(self.currentOperator.objName, "released from "+ self.objName)
# set the flag operatorAssignedTo to None # set the flag operatorAssignedTo to None
# XXX in case of skilled operators which stay at the same station should that change
self.currentOperator.operatorAssignedTo=None self.currentOperator.operatorAssignedTo=None
self.broker.invoke() self.broker.invoke()
self.toBeOperated = False self.toBeOperated = False
......
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