Commit 5bfbf793 authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Georgios Dagkakis

cherry-pick from readWIPseperatelly. MacnineManagedJob inherits and modifies...

cherry-pick from readWIPseperatelly. MacnineManagedJob inherits and modifies methods create- and initializeOperatorPool/Broker/Router
parent 6054bb0d
...@@ -45,35 +45,63 @@ class MachineManagedJob(MachineJobShop): ...@@ -45,35 +45,63 @@ class MachineManagedJob(MachineJobShop):
def initialize(self): def initialize(self):
MachineJobShop.initialize(self) MachineJobShop.initialize(self)
self.type="MachineManagedJob" self.type="MachineManagedJob"
# holds the Entity that is to be obtained and will be updated by canAcceptAndIsRequested
self.entityToGet=None
#===========================================================================
# create an operatorPool if needed
#===========================================================================
def createOperatorPool(self,operatorPool):
#create an empty Operator Pool. This will be updated by canAcceptAndIsRequested #create an empty Operator Pool. This will be updated by canAcceptAndIsRequested
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=[])
from Globals import G from Globals import G
G.OperatorPoolsList.append(self.operatorPool) G.OperatorPoolsList.append(self.operatorPool)
self.operatorPool.initialize()
self.operatorPool.operators=[] #===========================================================================
# create broker if needed
#===========================================================================
def createBroker(self):
#create a Broker #create a Broker
self.broker = Broker(self) self.broker = Broker(self)
self.broker.initialize()
self.env.process(self.broker.run()) #===========================================================================
# activate(self.broker,self.broker.run()) # create router if needed
#===========================================================================
def createRouter(self):
#create a Router #create a Router
# TODO: this is already performed in __init__ of Machine
from Globals import G from Globals import G
if not G.Router: if not G.Router:
self.router=Router() self.router=Router()
self.router.initialize()
G.Router=self.router G.Router=self.router
# otherwise set the already existing router as the machines Router # otherwise set the already existing router as the machines Router
else: else:
self.router=G.Router self.router=G.Router
#===========================================================================
# initialize broker if needed
#===========================================================================
def initializeOperatorPool(self):
self.operatorPool.initialize()
self.operatorPool.operators=[]
#===========================================================================
# initialize broker if needed
#===========================================================================
def initializeBroker(self):
self.broker.initialize()
self.env.process(self.broker.run())
#===========================================================================
# initialize router if needed
#===========================================================================
def initializeRouter(self):
if not self.router.isInitialized:
self.router.initialize()
if not self.router.isActivated: if not self.router.isActivated:
self.env.process(self.router.run()) self.env.process(self.router.run())
self.router.isActivated=True self.router.isActivated=True
# holds the Entity that is to be obtained and will be updated by canAcceptAndIsRequested
self.entityToGet=None
# ======================================================================= # =======================================================================
# checks if the Queue can accept an entity # checks if the Queue can accept an entity
......
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