Commit 16c0767d authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Jérome Perrin

ConditionalBuffer and MouldAssemblyBuffer to inherit fromQueueManagedJob....

ConditionalBuffer and MouldAssemblyBuffer to inherit fromQueueManagedJob. MouldAssembly to inherit from MachineManagedJob
parent cdec2b01
......@@ -22,10 +22,10 @@ Created on 15 Jan 2014
@author: Ioannis
'''
'''
Inherits from QueueJobShop. Checks the condition of (a) component(s) before it can dispose them/it
Inherits from QueueManagedJob. Checks the condition of (a) component(s) before it can dispose them/it
'''
from QueueJobShop import QueueJobShop
from QueueManagedJob import QueueManagedJob
from SimPy.Simulation import now
# ===========================================================================
......@@ -38,13 +38,13 @@ class NoCallerError(Exception):
# ===========================================================================
# the ConditionalBuffer object
# ===========================================================================
class ConditionalBuffer(QueueJobShop):
class ConditionalBuffer(QueueManagedJob):
# =======================================================================
# the default __init__ method of the QueueJobShop class
# the default __init__ method of the QueueManagedJob class
# whereas the default capacity is set to infinity
# =======================================================================
def __init__(self, id, name, capacity=-1, dummy=False, schedulingRule="FIFO"):
QueueJobShop.__init__(self, id=id, name=name, capacity=capacity, dummy=dummy, schedulingRule=schedulingRule)
QueueManagedJob.__init__(self, id=id, name=name, capacity=capacity, dummy=dummy, schedulingRule=schedulingRule)
# =======================================================================
# checks if the Buffer can dispose an entity.
......@@ -132,7 +132,7 @@ class ConditionalBuffer(QueueJobShop):
def sortEntities(self):
activeObject = self.getActiveObject()
# run the default sorting of the Queue first
QueueJobShop.sortEntities(self)
QueueManagedJob.sortEntities(self)
# and in the end sort according to the ConditionalBuffer sorting rule
activeObjectQueue = activeObject.getActiveObjectQueue()
# if the componentType of the entities in the activeQueue is Basic then don't move it to the end of the activeQ
......
......@@ -22,7 +22,7 @@ Created on 16 Jan 2014
@author: Ioannis
'''
'''
inherits from MachineJobShop. It takes the components of an order and reassembles them as mould
inherits from MachineManagedJob. It takes the components of an order and reassembles them as mould
'''
'''
......@@ -63,7 +63,7 @@ as a dictionary with the following layout if the mould is not already in WIP
There is no need to assign an exit, exit is assigned automatically by the createMould method
TODOs: check the case when a mould is already in the WIP by the beginning of the simulation
'''
from MachineJobShop import MachineJobShop
from MachineManagedJob import MachineManagedJob
from SimPy.Simulation import Resource, reactivate, now
from Globals import G
......@@ -75,16 +75,16 @@ class AssembleMouldError(Exception):
Exception.__init__(self, mouldAssembleError)
# ===========================================================================
# the MachineJobShop object
# the MachineManagedJob object
# ===========================================================================
class MouldAssembly(MachineJobShop):
class MouldAssembly(MachineManagedJob):
# =======================================================================
# the initialize method
# =======================================================================
def initialize(self):
self.mouldParent = None # the mould's to be assembled parent order
self.mouldToBeCreated = None # the mould to be assembled
MachineJobShop.initialize(self) # run default behaviour
MachineManagedJob.initialize(self) # run default behaviour
# =======================================================================
# getEntity method that gets the entity from the giver
......@@ -96,10 +96,10 @@ class MouldAssembly(MachineJobShop):
activeObject = self.getActiveObject()
giverObejct = activeObject.getGiverObject()
# get the first entity from the predecessor
# TODO: each MachineJobShop.getEntity is invoked,
# TODO: each MachineManagedJob.getEntity is invoked,
# the self.procTime is updated. Have to decide where to assign
# the processing time of the assembler
activeEntity=MachineJobShop.getEntity(self)
activeEntity=MachineManagedJob.getEntity(self)
# check weather the activeEntity is of type Mould
if activeEntity.type=='Mould':
# and return the mould received
......@@ -122,7 +122,7 @@ class MouldAssembly(MachineJobShop):
# all the components are received at the same time
while not orderGroupReceived:
# get the next component
activeEntity=MachineJobShop.getEntity(self)
activeEntity=MachineManagedJob.getEntity(self)
# check weather the activeEntity is of type Mould
try:
if activeEntity.type=='Mould':
......
......@@ -22,11 +22,11 @@ Created on 15 Jan 2014
@author: Ioannis
'''
'''
Inherits from QueueJobShop. It is the buffer before the MouldAssembly.
Inherits from QueueManagedJob. It is the buffer before the MouldAssembly.
Only if all the mould (order) components are present, will it be able to dispose them
'''
from QueueJobShop import QueueJobShop
from QueueManagedJob import QueueManagedJob
from SimPy.Simulation import now
# ===========================================================================
......@@ -39,13 +39,13 @@ class NoCallerError(Exception):
# ===========================================================================
# the MouldAssemblyBuffer object
# ===========================================================================
class MouldAssemblyBuffer(QueueJobShop):
class MouldAssemblyBuffer(QueueManagedJob):
# =======================================================================
# the default __init__ method of the QueueJobShop class
# the default __init__ method of the QueueManagedJob class
# whereas the default capacity is set to infinity
# =======================================================================
def __init__(self, id, name, capacity=-1, dummy=False, schedulingRule="FIFO"):
QueueJobShop.__init__(self, id=id, name=name, capacity=capacity, dummy=dummy, schedulingRule=schedulingRule)
QueueManagedJob.__init__(self, id=id, name=name, capacity=capacity, dummy=dummy, schedulingRule=schedulingRule)
# =======================================================================
# Sort the entities of the activeQ
......@@ -54,7 +54,7 @@ class MouldAssemblyBuffer(QueueJobShop):
def sortEntities(self):
activeObject = self.getActiveObject()
# run the default sorting of the Queue first
QueueJobShop.sortEntities(self)
QueueManagedJob.sortEntities(self)
# and in the end sort according to the ConditionalBuffer sorting rule
activeObjectQueue = activeObject.getActiveObjectQueue()
# if all the components of the same mould are present then move them to the front of the activeQ
......@@ -77,7 +77,7 @@ class MouldAssemblyBuffer(QueueJobShop):
def getEntity(self):
activeObject = self.getActiveObject()
activeObjectQueue = activeObject.getActiveObjectQueue()
activeEntity=QueueJobShop.getEntity(self) #execute default behaviour
activeEntity=QueueManagedJob.getEntity(self) #execute default behaviour
# if the activeEntity is of type orderComponent
try:
if activeEntity.componentType=='Basic' or 'Secondary':
......
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