Commit 20e93ba0 authored by Georgios Dagkakis's avatar Georgios Dagkakis

objects do not have to set flags to 0

parent ecb52198
......@@ -102,8 +102,6 @@ class BatchDecomposition(CoreObject):
yield self.interruptionEnd
self.expectedSignals['interruptionEnd']=0
transmitter, eventTime=self.interruptionEnd.value
assert self==transmitter, 'the victim of the failure is not the object that received the interruptionEnd event'
self.interruptionEnd=self.env.event()
......@@ -123,10 +121,6 @@ class BatchDecomposition(CoreObject):
self.isRequested=self.env.event()
break
self.expectedSignals['isRequested']=0
self.expectedSignals['interruptionStart']=0
self.expectedSignals['initialWIP']=0
if not self.isProcessingInitialWIP: # if we are in the state of having initial wip no need to take an Entity
self.currentEntity=self.getEntity()
......@@ -169,8 +163,6 @@ class BatchDecomposition(CoreObject):
yield self.entityRemoved
self.expectedSignals['entityRemoved']=0
transmitter, eventTime=self.entityRemoved.value
self.waitEntityRemoval=False
break
......@@ -191,16 +183,12 @@ class BatchDecomposition(CoreObject):
yield self.entityRemoved
self.expectedSignals['entityRemoved']=0
transmitter, eventTime=self.entityRemoved.value
self.waitEntityRemoval=False
break
self.entityRemoved=self.env.event()
self.expectedSignals['canDispose']=0
# =======================================================================
# removes an entity from the Machine
# =======================================================================
......
......@@ -96,8 +96,6 @@ class BatchReassembly(CoreObject):
yield self.interruptionEnd
self.expectedSignals['interruptionEnd']=0
transmitter, eventTime=self.interruptionEnd.value
assert self==transmitter, 'the victim of the failure is not the object that received the interruptionEnd event'
self.interruptionEnd=self.env.event()
......@@ -118,10 +116,6 @@ class BatchReassembly(CoreObject):
self.isProcessingInitialWIP=False
break
self.expectedSignals['isRequested']=0
self.expectedSignals['interruptionStart']=0
self.expectedSignals['initialWIP']=0
if not self.isProcessingInitialWIP: # if we are in the state of having initial wip no need to take an Entity
self.currentEntity=self.getEntity()
......@@ -163,8 +157,6 @@ class BatchReassembly(CoreObject):
yield self.interruptionEnd # interruptionEnd to be triggered by ObjectInterruption
self.expectedSignals['interruptionEnd']=0
transmitter, eventTime=self.interruptionEnd.value
assert eventTime==self.env.now, 'the victim of the failure is not the object that received it'
self.interruptionEnd=self.env.event()
......@@ -201,8 +193,6 @@ class BatchReassembly(CoreObject):
yield self.entityRemoved
self.expectedSignals['entityRemoved']=0
transmitter, eventTime=self.entityRemoved.value
self.printTrace(self.id, entityRemoved=eventTime)
assert eventTime==self.env.now,'entityRemoved event activated earlier than received'
......@@ -212,9 +202,6 @@ class BatchReassembly(CoreObject):
if not self.haveToDispose():
break
self.expectedSignals['interruptionStart']=0
self.expectedSignals['canDispose']=0
# =======================================================================
# removes an entity from the Machine
# =======================================================================
......
......@@ -71,8 +71,6 @@ class CapacityStationController(EventGenerator):
yield station.entityRemoved
station.expectedSignals['entityRemoved']=0
transmitter, eventTime=station.entityRemoved.value
station.waitEntityRemoval=False
exit.currentlyObtainedEntities.append(entity)
......@@ -130,8 +128,6 @@ class CapacityStationController(EventGenerator):
yield buffer.entityRemoved
buffer.expectedSignals['entityRemoved']=0
transmitter, eventTime=buffer.entityRemoved.value
buffer.waitEntityRemoval=False
buffer.entityRemoved=self.env.event()
......
......@@ -130,9 +130,6 @@ class Dismantle(CoreObject):
self.expectedSignals['isRequested']=1
yield self.isRequested #[self.isRequested,self.canDispose, self.loadOperatorAvailable]
self.expectedSignals['isRequested']=0
if self.isRequested.value:
# self.printTrace(self.id, isRequested=self.isRequested.value.id)
# reset the isRequested signal parameter
......@@ -176,9 +173,6 @@ class Dismantle(CoreObject):
self.expectedSignals['entityRemoved']=1
yield self.entityRemoved
self.expectedSignals['entityRemoved']=0
self.waitEntityRemoval=False
self.entityRemoved=self.env.event()
......@@ -190,7 +184,6 @@ class Dismantle(CoreObject):
self.waitToDisposeFrame=False #the Dismantle has no Frame to dispose now
break
self.expectedSignals['canDispose']=0
#===========================================================================
# checks if the Dismantle can accept an entity and there is a Frame
......
......@@ -127,8 +127,6 @@ class Failure(ObjectInterruption):
yield self.victimOnShift
self.expectedSignals['victimOnShift']=0
self.isWaitingForVictimOnShift=False
self.victimOnShift=self.env.event()
assert self.victim.onShift==True, 'the victim of shiftFailure must be onShift to continue counting the TTF'
......@@ -136,8 +134,6 @@ class Failure(ObjectInterruption):
self.isWaitingForVictimOffShift=False
failureNotTriggered=False
self.expectedSignals['victimOffShift']=0
# if time to failure counts only in working time
elif self.deteriorationType=='working':
# wait for victim to start process
......@@ -146,8 +142,6 @@ class Failure(ObjectInterruption):
yield self.victimStartsProcess
self.expectedSignals['victimStartsProcess']=0
self.victimStartsProcess=self.env.event()
while failureNotTriggered:
timeRestartedCounting=self.env.now
......@@ -164,15 +158,11 @@ class Failure(ObjectInterruption):
yield self.victimStartsProcess
self.expectedSignals['victimStartsProcess']=0
# wait for victim to start again processing
self.victimStartsProcess=self.env.event()
else:
failureNotTriggered=False
self.expectedSignals['victimEndsProcess']=0
# interrupt the victim
self.interruptVictim() # interrupt the victim
......
......@@ -428,11 +428,6 @@ class Machine(CoreObject):
self.loadTimeCurrentEntity = 0
self.setupTimeCurrentEntity = 0
self.expectedSignals['isRequested']=0
self.expectedSignals['interruptionEnd']=0
self.expectedSignals['loadOperatorAvailable']=0
self.expectedSignals['initialWIP']=0
# ======= request a resource
if(self.operatorPool!="None") and any(type=='Load' for type in self.multOperationTypeList):
# when it's ready to accept (canAcceptAndIsRequested) then inform the broker
......
......@@ -76,8 +76,6 @@ class Broker(ObjectInterruption):
yield self.isCalled
self.expectedSignals['isCalled']=0
transmitter, eventTime=self.isCalled.value
assert eventTime==self.env.now, 'the broker should be granted control instantly'
self.isCalled=self.env.event()
......@@ -110,8 +108,6 @@ class Broker(ObjectInterruption):
yield self.resourceAvailable
self.expectedSignals['resourceAvailable']=0
transmitter, eventTime=self.resourceAvailable.value
self.resourceAvailable=self.env.event()
# remove the currentEntity from the pendingEntities
......@@ -128,8 +124,6 @@ class Broker(ObjectInterruption):
yield self.resourceAvailable
self.expectedSignals['resourceAvailable']=0
transmitter, eventTime=self.resourceAvailable.value
self.resourceAvailable=self.env.event()
self.waitForOperator=False
......@@ -163,7 +157,6 @@ class Broker(ObjectInterruption):
yield self.isCalled
self.expectedSignals['isCalled']=0
transmitter, eventTime=self.isCalled.value
assert eventTime==self.env.now, 'the broker should be granted control instantly'
self.isCalled=self.env.event()
......
......@@ -111,8 +111,6 @@ class Router(ObjectInterruption):
yield self.isCalled
self.expectedSignals['isCalled']=0
transmitter, eventTime=self.isCalled.value
self.isCalled=self.env.event()
self.printTrace('','=-'*15)
......
......@@ -83,8 +83,6 @@ class RouterManaged(Router):
yield self.isCalled
self.expectedSignals['isCalled']=0
transmitter, eventTime=self.isCalled.value
self.isCalled=self.env.event()
self.printTrace('','=-'*15)
......
......@@ -89,9 +89,6 @@ class OrderDecomposition(CoreObject):
transmitter, eventTime=self.canDispose.value
self.canDispose=self.env.event()
self.expectedSignals['isRequested']=0
self.expectedSignals['canDispose']=0
# if the event that activated the thread is canDispose then signalReceiver
if self.haveToDispose():
# print now(), self.id, 'will try to signal a receiver from generator'
......
......@@ -87,8 +87,6 @@ class ScheduledMaintenance(ObjectInterruption):
yield self.victim.endedLastProcessing # there is no signal yet that signals the change of such state (an object getting empty)
self.expectedSignals['endedLastProcessing']=0
transmitter, eventTime=self.victim.endedLastProcessing.value
assert eventTime==self.env.now, 'the processing end signal is not received by maintenance on time'
self.victim.endedLastProcessing=self.env.event()
......@@ -104,8 +102,6 @@ class ScheduledMaintenance(ObjectInterruption):
yield self.victimIsEmptyBeforeMaintenance # there is no signal yet that signals the change of such state (an object getting empty)
self.expectedSignals['victimIsEmptyBeforeMaintenance']=0
transmitter, eventTime=self.victimIsEmptyBeforeMaintenance.value
assert eventTime==self.env.now, 'the processing end signal is not received by maintenance on time'
self.victimIsEmptyBeforeMaintenance=self.env.event()
......
......@@ -116,7 +116,6 @@ class ShiftScheduler(ObjectInterruption):
self.waitingSignal=True
self.expectedSignals['endedLastProcessing']=1
yield self.victim.endedLastProcessing
self.expectedSignals['endedLastProcessing']=0
transmitter, eventTime=self.victim.endedLastProcessing.value
self.victim.endedLastProcessing=self.env.event()
self.interruptVictim()
......
......@@ -75,8 +75,6 @@ class SkilledRouter(Router):
yield self.isCalled
self.expectedSignals['isCalled']=0
transmitter, eventTime=self.isCalled.value
self.isCalled=self.env.event()
self.printTrace('','=-'*15)
......@@ -137,8 +135,6 @@ class SkilledRouter(Router):
receivedEvent=yield self.env.all_of(self.endProcessingSignals)
self.expectedSignals['endedLastProcessing']=0
for station in self.busyStations:
if station.endedLastProcessing in receivedEvent:
transmitter, eventTime=station.endedLastProcessing.value
......
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