Commit 07960299 authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Sebastien Robin

variable exitAssignedToReceiver added. This variable assignes the exit of an object to a successor

parent b60a693b
......@@ -64,7 +64,11 @@ class Assembly(CoreObject):
self.predecessorIndex=0 #holds the index of the predecessor from which the Assembly will take an entity next
self.successorIndex=0 #holds the index of the successor where the Assembly will dispose an entity next
# ============================== variable that is used for the loading of machines =============
self.exitAssignedToReceiver = False # by default the objects are not blocked
# when the entities have to be loaded to operatedMachines
# then the giverObjects have to be blocked for the time
# that the machine is being loaded
def initialize(self):
Process.__init__(self)
......
......@@ -53,6 +53,11 @@ class Conveyer(CoreObject):
self.predecessorIndex=0 #holds the index of the predecessor from which the Conveyer will take an entity next
self.successorIndex=0 #holds the index of the successor where the Queue Conveyer dispose an entity next
# ============================== variable that is used for the loading of machines =============
self.exitAssignedToReceiver = False # by default the objects are not blocked
# when the entities have to be loaded to operatedMachines
# then the giverObjects have to be blocked for the time
# that the machine is being loaded
def initialize(self):
Process.__init__(self)
......
......@@ -63,8 +63,13 @@ class CoreObject(Process):
self.waitToDispose=False #shows if the object waits to dispose an entity
# ============================== the below are currently used in Jobshop =======================
self.giver=None #the CoreObject that the activeObject will take an Entity from
self.receiver=None #the CoreObject that the activeObject will give an Entity to
self.giver=None #the CoreObject that the activeObject will take an Entity from
self.receiver=None #the CoreObject that the activeObject will give an Entity to
# ============================== variable that is used for the loading of machines =============
self.exitAssignedToReceiver = False # by default the objects are not blocked
# when the entities have to be loaded to operatedMachines
# then the giverObjects have to be blocked for the time
# that the machine is being loaded
# ======================== the main process of the core object =================================
# ================ this is dummy, every object must have its own implementation ================
......@@ -105,6 +110,9 @@ class CoreObject(Process):
activeObjectQueue.append(activeEntity)
#remove the entity from the previous object
giverObject.removeEntity()
# if the giverObject is blocked then unBlock it
if giverObject.exitIsAssigned():
giverObject.unAssignExit()
#append the time to schedule so that it can be read in the result
#remember that every entity has it's schedule which is supposed to be updated every time
# the entity enters a new object
......@@ -199,4 +207,22 @@ class CoreObject(Process):
# calculates the processing time
# =======================================================================
def calculateProcessingTime(self):
return self.rng.generateNumber() # this is if we have a default processing time for all the entities
\ No newline at end of file
return self.rng.generateNumber() # this is if we have a default processing time for all the entities
# =======================================================================
# checks if the machine is blocked
# =======================================================================
def exitIsAssigned(self):
return self.exitAssignedToReceiver
# =======================================================================
# assign Exit of the object
# =======================================================================
def assignExit(self):
self.exitAssignedToReceiver = True
# =======================================================================
# unblock the object
# =======================================================================
def unAssignExit(self):
self.exitAssignedToReceiver = False
\ No newline at end of file
......@@ -63,6 +63,12 @@ class Dismantle(CoreObject):
self.Blockage=[]
self.predecessorIndex=0 #holds the index of the predecessor from which the Dismantle will take an entity next
self.successorIndex=0 #holds the index of the successor where the Dismantle will dispose an entity next
# ============================== variable that is used for the loading of machines =============
self.exitAssignedToReceiver = False # by default the objects are not blocked
# when the entities have to be loaded to operatedMachines
# then the giverObjects have to be blocked for the time
# that the machine is being loaded
def initialize(self):
......
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