Commit 76df5179 authored by Georgios Dagkakis's avatar Georgios Dagkakis

objects do not have to set flags to 0

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