comments added and clean-up

parent 8325afd1
......@@ -266,6 +266,10 @@ class CoreObject(Process):
#if the receiver does not hold an Entity that is also critical
if not self.receiver.getActiveObjectQueue()[0].isCritical:
self.receiver.shouldPreempt=True
#=======================================================
# testing
print now(), self.id, 'preempting receiver', self.receiver.id,'.. '*6
#=======================================================
self.receiver.preempt()
self.receiver.timeLastEntityEnded=now() #required to count blockage correctly in the preemptied station
......
......@@ -248,29 +248,6 @@ class Machine(CoreObject):
if self.signalGiver():
break
# TODO: maybe here have to assigneExit of the giver and add self to operator activeCallers list
#===============================================================================
# # reset the canProceedWithGetEntity flag
# self.canProceedWithGetEntity=False
#
# #===================================================================
# # # TESTING
# # print now(), self.id, 'is in position to get'
# #===================================================================
#
# # if the machine must be operated for the loading then the operators must be picked wisely for every machine
# if (self.operatorPool!="None")\
# and any(type=="Load" for type in self.multOperationTypeList):
# # the machine informs the router that it can receive from a requesting object
# self.requestRouter()
# self.router.startCycle.signal(self.id)
# # the machine must wait until the router has decided which machine will operated by which operator
# # yield waitevent, self, self.routerCycleOver
# yield waituntil, self, self.router.isSet
# self.router.victim=None
# # if the machine is not picked by the router the it should wait again
# if not self.canProceedWithGetEntity:
# continue
#===============================================================================
# here or in the getEntity (apart from the loadTimeCurrentEntity)
# in case they are placed inside the getEntity then the initialize of
......@@ -562,6 +539,10 @@ class Machine(CoreObject):
activeObject=self.getActiveObject()
activeObjectQueue=activeObject.getActiveObjectQueue()
activeEntity=activeObjectQueue[0]
#=======================================================================
# testing
print self.getActiveObjectQueue()[0].name, "Interrupted at ",self.objName, '. '*5
#=======================================================================
# if the interrupt occured while processing an entity
if not activeObject.waitToDispose:
# output to trace that the Machine (self.objName) got interrupted
......
......@@ -227,6 +227,10 @@ class MachineJobShop(Machine):
# method to execute preemption
# =======================================================================
def preempt(self):
#=======================================================================
# testing
print now(), self.id, 'preempting', ' .'*7
#=======================================================================
activeObject=self.getActiveObject()
activeEntity=self.getActiveObjectQueue()[0] #get the active Entity
#calculate the remaining processing time
......
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