Commit be9501e9 authored by Georgios Dagkakis's avatar Georgios Dagkakis

Router activation works now in multiple runs

parent 82b5b943
......@@ -1274,7 +1274,10 @@ def main(argv=[], input_data=None):
G.env=simpy.Environment() # initialize the environment
G.maxSimTime=float(G.JSONData['general'].get('maxSimTime', '100')) # read the maxSimTime in each replication
# since it may be changed for infinite ones
if G.Router:
G.Router.isActivated=False
G.Router.isInitialized=False
if G.seed:
G.Rnd=Random('%s%s' % (G.seed, i))
else:
......
......@@ -142,7 +142,7 @@ class Machine(CoreObject):
# otherwise set the already existing router as the machines Router
else:
self.router=G.Router
# lists to hold statistics of multiple runs
#lists to hold statistics of multiple runs
self.WaitingForOperator=[]
self.WaitingForLoadOperator=[]
self.Loading = []
......@@ -172,7 +172,9 @@ class Machine(CoreObject):
# initialise the router only once
if not self.router.isInitialized:
self.router.initialize()
if not self.router.isActivated:
self.env.process(self.router.run())
self.router.isActivated=True
for operator in self.operatorPool.operators:
operator.coreObjectIds.append(self.id)
operator.coreObjects.append(self)
......
......@@ -64,12 +64,13 @@ class MachineManagedJob(MachineJobShop):
if not G.Router:
self.router=Router()
self.router.initialize()
self.env.process(self.router.run())
# activate(self.router,self.router.run())
G.Router=self.router
G.Router=self.router
# otherwise set the already existing router as the machines Router
else:
self.router=G.Router
if not self.router.isActivated:
self.env.process(self.router.run())
self.router.isActivated=True
# holds the Entity that is to be obtained and will be updated by canAcceptAndIsRequested
self.entityToGet=None
......
......@@ -50,6 +50,7 @@ class Router(ObjectInterruption):
ObjectInterruption.__init__(self)
self.type = "Router"
self.isInitialized=False
self.isActivated=False
self.candidateOperators=[]
self.multipleCriterionList=[]
self.schedulingRule='WT'
......
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