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

CoreObject to use ManPyObject method

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