Commit 189c43c4 authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Jérome Perrin

objects that did inherit from Machine/QueuePreemptive changed to inherit from Machine/QueueJobShop

parent dbb723e0
......@@ -22,10 +22,10 @@ Created on 15 Jan 2014
@author: Ioannis
'''
'''
Inherits from QueuePreemptive. Checks the condition of (a) component(s) before it can dispose them/it
Inherits from QueueJobShop. Checks the condition of (a) component(s) before it can dispose them/it
'''
from QueuePreemptive import QueuePreemptive
from QueueJobShop import QueueJobShop
from SimPy.Simulation import now
# ===========================================================================
......@@ -36,15 +36,15 @@ class NoCallerError(Exception):
Exception.__init__(self, callerError)
# ===========================================================================
# the QueuePreemptive object
# the ConditionalBuffer object
# ===========================================================================
class ConditionalBuffer(QueuePreemptive):
class ConditionalBuffer(QueueJobShop):
# =======================================================================
# the default __init__ method of the QueuePreemptive class
# the default __init__ method of the QueueJobShop class
# whereas the default capacity is set to infinity
# =======================================================================
def __init__(self, id, name, capacity=-1, dummy=False, schedulingRule="FIFO"):
QueuePreemptive.__init__(self, id=id, name=name, capacity=capacity, dummy=dummy, schedulingRule=schedulingRule)
QueueJobShop.__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(QueuePreemptive):
def sortEntities(self):
activeObject = self.getActiveObject()
# run the default sorting of the Queue first
QueuePreemptive.sortEntities(self)
QueueJobShop.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 MachinePreemptive. It takes the components of an order and reassembles them as mould
inherits from MachineJobShop. 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 MachinePreemptive import MachinePreemptive
from MachineJobShop import MachineJobShop
from SimPy.Simulation import Resource, reactivate, now
from Globals import G
......@@ -77,14 +77,14 @@ class AssembleMouldError(Exception):
# ===========================================================================
# the MachineJobShop object
# ===========================================================================
class MouldAssembly(MachinePreemptive):
class MouldAssembly(MachineJobShop):
# =======================================================================
# 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
MachinePreemptive.initialize(self) # run default behaviour
MachineJobShop.initialize(self) # run default behaviour
# =======================================================================
# getEntity method that gets the entity from the giver
......@@ -96,10 +96,10 @@ class MouldAssembly(MachinePreemptive):
activeObject = self.getActiveObject()
giverObejct = activeObject.getGiverObject()
# get the first entity from the predecessor
# TODO: each machinePreemtive.getEntity is invoked,
# TODO: each MachineJobShop.getEntity is invoked,
# the self.procTime is updated. Have to decide where to assign
# the processing time of the assembler
activeEntity=MachinePreemptive.getEntity(self)
activeEntity=MachineJobShop.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(MachinePreemptive):
# all the components are received at the same time
while not orderGroupReceived:
# get the next component
activeEntity=MachinePreemptive.getEntity(self)
activeEntity=MachineJobShop.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 QueuePreemptive. It is the buffer before the MouldAssembly.
Inherits from QueueJobShop. It is the buffer before the MouldAssembly.
Only if all the mould (order) components are present, will it be able to dispose them
'''
from QueuePreemptive import QueuePreemptive
from QueueJobShop import QueueJobShop
from SimPy.Simulation import now
# ===========================================================================
......@@ -39,13 +39,13 @@ class NoCallerError(Exception):
# ===========================================================================
# the MouldAssemblyBuffer object
# ===========================================================================
class MouldAssemblyBuffer(QueuePreemptive):
class MouldAssemblyBuffer(QueueJobShop):
# =======================================================================
# the default __init__ method of the QueuePreemptive class
# the default __init__ method of the QueueJobShop class
# whereas the default capacity is set to infinity
# =======================================================================
def __init__(self, id, name, capacity=-1, dummy=False, schedulingRule="FIFO"):
QueuePreemptive.__init__(self, id=id, name=name, capacity=capacity, dummy=dummy, schedulingRule=schedulingRule)
QueueJobShop.__init__(self, id=id, name=name, capacity=capacity, dummy=dummy, schedulingRule=schedulingRule)
# =======================================================================
# Sort the entities of the activeQ
......@@ -54,7 +54,7 @@ class MouldAssemblyBuffer(QueuePreemptive):
def sortEntities(self):
activeObject = self.getActiveObject()
# run the default sorting of the Queue first
QueuePreemptive.sortEntities(self)
QueueJobShop.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(QueuePreemptive):
def getEntity(self):
activeObject = self.getActiveObject()
activeObjectQueue = activeObject.getActiveObjectQueue()
activeEntity=QueuePreemptive.getEntity(self) #execute default behaviour
activeEntity=QueueJobShop.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