Commit 3d1387da authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Georgios Dagkakis

Jobshop objects updated to follow the new signalling

parent 28d10945
......@@ -292,7 +292,8 @@ class MachineJobShop(Machine):
self.receiver.timeLastEntityEnded=self.env.now #required to count blockage correctly in the preemptied station
# TODO: use a signal and wait for it, reactivation is not recognised as interruption
# reactivate(self)
self.preemptQueue.succeed(self.env.now)
succeedTuple=(self,self.env.now)
self.preemptQueue.succeed(succeedTuple)
# TODO: consider the case when a failure has the Station down. The event preempt will not be received now()
# but at a later simulation time.
......
......@@ -110,7 +110,8 @@ class MouldAssemblyBuffer(QueueManagedJob):
for secondary in [x for x in activeEntity.order.secondaryComponentsList if activeEntity.order.basicsEnded]:
if secondary.currentStation.__class__.__name__=='ConditionalBuffer':
# print now(), self.id, ' signalling conditional buffer'
secondary.currentStation.canDispose.succeed(self.env.now)
succeedTuple=(self,self.env.now)
secondary.currentStation.canDispose.succeed(succeedTuple)
break
# for all the components that have the same parent Order as the activeEntity
activeEntity.order.componentsReadyForAssembly = 1
......
......@@ -79,6 +79,7 @@ class RouterManaged(Router):
while 1:
# wait until the router is called
yield self.isCalled
transmitter, eventTime=self.isCalled.value
self.isCalled=self.env.event()
self.printTrace('','=-'*15)
self.printTrace('','router received event')
......@@ -192,7 +193,8 @@ class RouterManaged(Router):
if station in self.pendingMachines and station in self.toBeSignalled:
# signal this station's broker that the resource is available
self.printTrace('router','signalling broker of'+' '*50+operator.isAssignedTo().id)
operator.isAssignedTo().broker.resourceAvailable.succeed(self.env.now)
succeedTuple=(self,self.env.now)
operator.isAssignedTo().broker.resourceAvailable.succeed(succeedTuple)
elif (not station in self.pendingMachines) or (not station in self.toBeSignalled):
# signal the queue proceeding the station
assert operator.candidateEntity.currentStation in self.toBeSignalled, 'the candidateEntity currentStation is not picked by the Router'
......@@ -202,7 +204,8 @@ class RouterManaged(Router):
# if the station is already is already signalled then do not send event
if not operator.candidateEntity.currentStation.loadOperatorAvailable.triggered:
self.printTrace('router','signalling queue'+' '*50+operator.candidateEntity.currentStation.id)
operator.candidateEntity.currentStation.loadOperatorAvailable.succeed(self.env.now)
succeedTuple=(self,self.env.now)
operator.candidateEntity.currentStation.loadOperatorAvailable.succeed(succeedTuple)
#===========================================================================
# clear the pending lists of the router
......
......@@ -75,12 +75,14 @@ class OrderDecomposition(CoreObject):
receivedEvent=yield self.env.any_of([self.isRequested , self.canDispose])
# if the event that activated the thread is isRequested then getEntity
if self.isRequested in receivedEvent:
transmitter, eventTime=self.isRequested.value
self.isRequested=self.env.event()
# reset the isRequested signal parameter
self.isRequested.signalparam=None
self.getEntity()
self.decompose()
if self.canDispose in receivedEvent:
transmitter, eventTime=self.canDispose.value
self.canDispose=self.env.event()
# if the event that activated the thread is canDispose then signalReceiver
if self.haveToDispose():
......
......@@ -120,7 +120,8 @@ class QueueManagedJob(QueueJobShop):
if not G.Router.invoked:
# self.printTrace(self.id, signal='router')
G.Router.invoked=True
G.Router.isCalled.succeed(G.env.now)
succeedTuple=(G.env, G.env.now)
G.Router.isCalled.succeed(succeedTuple)
return True
except:
return False
......
......@@ -71,6 +71,7 @@ class SkilledRouter(Router):
while 1:
# wait until the router is called
yield self.isCalled
transmitter, eventTime=self.isCalled.value
self.isCalled=self.env.event()
self.printTrace('','=-'*15)
self.printTrace('','router received event')
......@@ -128,6 +129,7 @@ class SkilledRouter(Router):
receivedEvent=yield self.env.all_of(self.endProcessingSignals)
for station in self.busyStations:
if station.endedLastProcessing in receivedEvent:
transmitter, eventTime=station.endedLastProcessing.value
station.endedLastProcessing=self.env.event()
......@@ -240,13 +242,15 @@ class SkilledRouter(Router):
if station.broker.waitForOperator:
# signal this station's broker that the resource is available
self.printTrace('router', 'signalling broker of'+' '*50+station.id)
station.broker.resourceAvailable.succeed(self.env.now)
succeedTuple=(self,self.env.now)
station.broker.resourceAvailable.succeed(succeedTuple)
else:
# signal the queue proceeding the station
if station.canAccept()\
and any(type=='Load' for type in station.multOperationTypeList):
self.printTrace('router', 'signalling'+' '*50+station.id)
station.loadOperatorAvailable.succeed(self.env.now)
succeedTuple=(self,self.env.now)
station.loadOperatorAvailable.succeed(succeedTuple)
#===================================================================
# default behaviour
......
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