Commit 9986bb6c authored by Georgios Dagkakis's avatar Georgios Dagkakis

blocking also to be calculate by the state

parent 9503d779
......@@ -155,6 +155,11 @@ class CoreObject(object):
# flag that locks the entry of an object so that it cannot receive entities
self.isLocked=False
# flag that shows if the Machine is processing state at any given time
self.isProcessing=False
# flag that shows if the Machine is blocked state at any given time
self.isBlocked=False
# =======================================================================
# the main process of the core object
# this is dummy, every object must have its own implementation
......@@ -196,6 +201,7 @@ class CoreObject(object):
# as argument by getEntity of the receiver
# =======================================================================
def removeEntity(self, entity=None):
self.isBlocked=False
self.addBlockage()
activeObjectQueue=self.Res.users
......
This diff is collapsed.
......@@ -44,8 +44,11 @@ class MachineJobShop(Machine):
# actions to be carried out when the processing of an Entity ends
# =======================================================================
def endProcessingActions(self):
# set isProcessing to False
self.isProcessing=False
# add working time
self.totalWorkingTime+=self.env.now-self.timeLastProcessingStarted
self.timeLastBlockageStarted=self.env.now
activeObject=self.getActiveObject()
activeObjectQueue=activeObject.Res.users
......@@ -87,11 +90,6 @@ class MachineJobShop(Machine):
#do this so that if it is overtime working it is not counted as off-shift time
if not activeObject.onShift:
activeObject.timeLastShiftEnded=self.env.now
# update the total working time # the total processing time for this entity is what the distribution initially gave
# if not self.shouldPreempt:
# activeObject.totalWorkingTime+=activeObject.totalProcessingTimeInCurrentEntity
# else:
# activeObject.totalWorkingTime+=self.env.now-(self.timeLastEntityEntered)
# update the variables keeping track of Entity related attributes of the machine
activeObject.timeLastEntityEnded=self.env.now # this holds the time that the last entity ended processing in Machine
activeObject.nameLastEntityEnded=activeObject.currentEntity.name # this holds the name of the last entity that ended processing in Machine
......@@ -99,6 +97,8 @@ class MachineJobShop(Machine):
# reset flags
self.shouldPreempt=False
self.isProcessingInitialWIP=False
# blocking starts
self.isBlocked=True
# TODO: collapse that to Machine
......
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