Commit 6bbaeaf2 authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Georgios Dagkakis

naming conventions for skilledOperator flag and checkForSkilledOperators changed

parent be502b94
...@@ -370,7 +370,7 @@ class CoreObject(object): ...@@ -370,7 +370,7 @@ class CoreObject(object):
# check if the any of the operators are skilled (having a list of skills regarding the machines) # check if the any of the operators are skilled (having a list of skills regarding the machines)
#=========================================================================== #===========================================================================
@staticmethod @staticmethod
def checkForSkilledOperators(): def checkForDedicatedOperators():
from Globals import G from Globals import G
# XXX this can also be global # XXX this can also be global
# flag used to inform if the operators assigned to the station are skilled (skillsList) # flag used to inform if the operators assigned to the station are skilled (skillsList)
...@@ -412,7 +412,7 @@ class CoreObject(object): ...@@ -412,7 +412,7 @@ class CoreObject(object):
self.preemptReceiver() self.preemptReceiver()
# TODO if the station is operated, and the operators have skills defined then the SkilledOperatorRouter should be signalled # TODO if the station is operated, and the operators have skills defined then the SkilledOperatorRouter should be signalled
# XXX: there may be a case where one machine is not assigned an operator, in that case we do not want to invoke the allocation routine # XXX: there may be a case where one machine is not assigned an operator, in that case we do not want to invoke the allocation routine
if self.checkForSkilledOperators(): if self.checkForDedicatedOperators():
allocationNeeded=False allocationNeeded=False
for nextObj in self.next: for nextObj in self.next:
if nextObj.operatorPool!='None': if nextObj.operatorPool!='None':
...@@ -460,7 +460,7 @@ class CoreObject(object): ...@@ -460,7 +460,7 @@ class CoreObject(object):
def signalRouter(receiver=None): def signalRouter(receiver=None):
# if an operator is not assigned to the receiver then do not signal the receiver but the Router # if an operator is not assigned to the receiver then do not signal the receiver but the Router
try: try:
# XXX in the case of skilledOperators assignedOperators must be always True in order to avoid invoking the Router # XXX in the case of dedicatedOperator assignedOperators must be always True in order to avoid invoking the Router
if not receiver.assignedOperator or\ if not receiver.assignedOperator or\
(receiver.isPreemptive and len(receiver.Res.users)>0): (receiver.isPreemptive and len(receiver.Res.users)>0):
if receiver.isLoadRequested(): if receiver.isLoadRequested():
......
...@@ -90,7 +90,7 @@ class Machine(CoreObject): ...@@ -90,7 +90,7 @@ class Machine(CoreObject):
self.MTTR=MTTR self.MTTR=MTTR
self.availability=availability self.availability=availability
# check whether the operators are provided with a skills set # check whether the operators are provided with a skills set
self.skilledOperators=self.checkForSkilledOperators() self.dedicatedOperator=self.checkForDedicatedOperators()
# 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
...@@ -211,7 +211,7 @@ class Machine(CoreObject): ...@@ -211,7 +211,7 @@ class Machine(CoreObject):
# otherwise # otherwise
else: else:
# if there are operators with skillList # if there are operators with skillList
if self.skilledOperators: if self.dedicatedOperator:
id = self.id+'_OP' id = self.id+'_OP'
name=self.objName+'_operatorPool' name=self.objName+'_operatorPool'
self.operatorPool=OperatorPool(id,name,operatorsList=[]) self.operatorPool=OperatorPool(id,name,operatorsList=[])
...@@ -241,8 +241,8 @@ class Machine(CoreObject): ...@@ -241,8 +241,8 @@ class Machine(CoreObject):
from Globals import G from Globals import G
# if there is no router # if there is no router
if not G.Router: if not G.Router:
# TODO if the skilledOperators flag is raised then create a SkilledRouter (temp) # TODO if the dedicatedOperator flag is raised then create a SkilledRouter (temp)
if self.skilledOperators: if self.dedicatedOperator:
self.router=SkilledRouter() self.router=SkilledRouter()
else: else:
self.router=Router() self.router=Router()
...@@ -257,8 +257,8 @@ class Machine(CoreObject): ...@@ -257,8 +257,8 @@ class Machine(CoreObject):
# initialise the operator pool if any # initialise the operator pool if any
if (self.operatorPool!="None"): if (self.operatorPool!="None"):
self.operatorPool.initialize() self.operatorPool.initialize()
# if the flag skilledOperators is true then reset/empty the operators list of the pool # if the flag dedicatedOperator is true then reset/empty the operators list of the pool
if self.skilledOperators: if self.dedicatedOperator:
self.operatorPool.operators=[] self.operatorPool.operators=[]
# otherwise update the coreObjectIds/coreObjects list of the operators # otherwise update the coreObjectIds/coreObjects list of the operators
else: else:
...@@ -876,7 +876,7 @@ class Machine(CoreObject): ...@@ -876,7 +876,7 @@ class Machine(CoreObject):
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 # XXX in case of skilled operators which stay at the same station should that change
if not self.checkForSkilledOperators(): if not self.checkForDedicatedOperators():
self.currentOperator.unAssign() self.currentOperator.unAssign()
self.broker.invoke() self.broker.invoke()
self.toBeOperated = False self.toBeOperated = False
......
...@@ -85,7 +85,7 @@ class Broker(ObjectInterruption): ...@@ -85,7 +85,7 @@ class Broker(ObjectInterruption):
# if the victim already holds an entity that means that the machine's operation type # if the victim already holds an entity that means that the machine's operation type
# is no Load or setup, in that case the router is already invoked and the machine is already assigned an operator # is no Load or setup, in that case the router is already invoked and the machine is already assigned an operator
from Globals import G from Globals import G
if not self.victim.checkForSkilledOperators(): if not self.victim.checkForDedicatedOperators():
if not self.victimQueueIsEmpty(): if not self.victimQueueIsEmpty():
# add the currentEntity to the pendingEntities # add the currentEntity to the pendingEntities
if not self.victim.currentEntity in G.pendingEntities: if not self.victim.currentEntity in G.pendingEntities:
...@@ -134,7 +134,7 @@ class Broker(ObjectInterruption): ...@@ -134,7 +134,7 @@ class Broker(ObjectInterruption):
self.isCalled=self.env.event() self.isCalled=self.env.event()
# The operator is released (the router is not called in the case of skilled ops that work constantly on the same machine) # The operator is released (the router is not called in the case of skilled ops that work constantly on the same machine)
if not self.victim.checkForSkilledOperators(): if not self.victim.checkForDedicatedOperators():
if not self.victim.isOperated(): if not self.victim.isOperated():
self.victim.currentOperator.totalWorkingTime+=self.env.now-self.victim.currentOperator.timeLastOperationStarted self.victim.currentOperator.totalWorkingTime+=self.env.now-self.victim.currentOperator.timeLastOperationStarted
# signal the other brokers waiting for the same operators that they are now free # signal the other brokers waiting for the same operators that they are now free
......
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