Commit 6c1013bc authored by Georgios Dagkakis's avatar Georgios Dagkakis

CoreObject to use ManPyObject method

parent d00abf64
......@@ -123,11 +123,11 @@ class CapacityStationController(EventGenerator):
for entity in entitiesToCheck:
if not entity.shouldMove: # when the first entity that should not move is reached break
break
if station.expectedSignals['isRequested']:
succeedTuple=(buffer,self.env.now)
station.isRequested.succeed(succeedTuple) # send is requested to station
station.expectedSignals['isRequested']=0
# wait until the entity is removed
# ToDo, here we do not check if station.expectedSignals['isRequested']==1
# consistency problem?
succeedTuple=(buffer,self.env.now)
station.isRequested.succeed(succeedTuple) # send is requested to station
station.expectedSignals['isRequested']=0
buffer.waitEntityRemoval=True
buffer.expectedSignals['entityRemoved']=1
......
......@@ -290,24 +290,9 @@ class CoreObject(ManPyObject):
# update wipStatList
if self.gatherWipStat:
self.wipStatList.append([self.env.now, len(activeObjectQueue)])
if self.entityRemoved.triggered:
if self.entityRemoved.value!=self.env.now and self.waitEntityRemoval and self.expectedSignals['entityRemoved']:
# print self.id,'triggered and waiting'
self.entityRemoved=self.env.event()
self.printTrace(self.id, signal='(removedEntity)')
succeedTuple=(self,self.env.now)
self.entityRemoved.succeed(succeedTuple)
self.expectedSignals['entityRemoved']=0
elif self.waitEntityRemoval and self.expectedSignals['entityRemoved']:
# print self.id,'not triggered and waiting'
if self.expectedSignals['entityRemoved']:
self.printTrace(self.id, signal='(removedEntity)')
succeedTuple=(self,self.env.now)
self.entityRemoved.succeed(succeedTuple)
self.expectedSignals['entityRemoved']=0
elif not self.waitEntityRemoval and not self.expectedSignals['entityRemoved']:
# print self.id,'not triggered but not waiting'
pass
self.sendSignal(receiver=self, signal=self.entityRemoved)
return entity
#===========================================================================
......@@ -494,9 +479,7 @@ class CoreObject(ManPyObject):
# assign the entry of the receiver
self.receiver.assignEntryTo()
if self.receiver.expectedSignals['isRequested']:
succeedTuple=(self,self.env.now)
self.receiver.isRequested.succeed(succeedTuple)
self.receiver.expectedSignals['isRequested']=0
self.sendSignal(receiver=self.receiver, signal=self.receiver.isRequested)
return True
# if no receiver can accept then try to preempt a receive if the stations holds a critical order
self.preemptReceiver()
......
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