Commit cc5d571e authored by Georgios Dagkakis's avatar Georgios Dagkakis

objects to be able to accept additional keywords and cleanup of deprecated code

parent 3cc9ee98
...@@ -41,7 +41,7 @@ class Assembly(CoreObject): ...@@ -41,7 +41,7 @@ class Assembly(CoreObject):
#=========================================================================== #===========================================================================
# initialize the object # initialize the object
#=========================================================================== #===========================================================================
def __init__(self, id='', name='', processingTime=None, inputsDict=None): def __init__(self, id='', name='', processingTime=None, inputsDict=None, **kw):
self.type="Assembly" #String that shows the type of object self.type="Assembly" #String that shows the type of object
self.next=[] #list with the next objects in the flow self.next=[] #list with the next objects in the flow
self.previous=[] #list with the previous objects in the flow self.previous=[] #list with the previous objects in the flow
......
...@@ -34,7 +34,7 @@ from SubBatch import SubBatch ...@@ -34,7 +34,7 @@ from SubBatch import SubBatch
class Batch(Entity): class Batch(Entity):
type="Batch" type="Batch"
def __init__(self, id, name, numberOfUnits=1, remainingProcessingTime=0, unitsToProcess=0): def __init__(self, id, name, numberOfUnits=1, remainingProcessingTime=0, unitsToProcess=0, **kw):
Entity.__init__(self, name=name, id=id, remainingProcessingTime=remainingProcessingTime) Entity.__init__(self, name=name, id=id, remainingProcessingTime=remainingProcessingTime)
self.numberOfUnits=int(numberOfUnits) self.numberOfUnits=int(numberOfUnits)
self.numberOfSubBatches=1 #integer that shows in how many sub batches is the batch broken self.numberOfSubBatches=1 #integer that shows in how many sub batches is the batch broken
......
...@@ -45,7 +45,7 @@ class BatchDecomposition(CoreObject): ...@@ -45,7 +45,7 @@ class BatchDecomposition(CoreObject):
# ======================================================================= # =======================================================================
#initialize the id, the capacity of the object and the distribution #initialize the id, the capacity of the object and the distribution
# ======================================================================= # =======================================================================
def __init__(self, id, name, processingTime=None, numberOfSubBatches=1, operator='None'): def __init__(self, id, name, processingTime=None, numberOfSubBatches=1, operator='None', **kw):
CoreObject.__init__(self, id, name) CoreObject.__init__(self, id, name)
self.type="BatchDecomposition" #String that shows the type of object self.type="BatchDecomposition" #String that shows the type of object
......
...@@ -44,7 +44,7 @@ class BatchReassembly(CoreObject): ...@@ -44,7 +44,7 @@ class BatchReassembly(CoreObject):
# ======================================================================= # =======================================================================
#initialize the id, the capacity of the object and the distribution #initialize the id, the capacity of the object and the distribution
# ======================================================================= # =======================================================================
def __init__(self, id, name, numberOfSubBatches=1, processingTime=None, operator='None'): def __init__(self, id, name, numberOfSubBatches=1, processingTime=None, operator='None', **kw):
CoreObject.__init__(self,id, name) CoreObject.__init__(self,id, name)
self.type="BatchRassembly" #String that shows the type of object self.type="BatchRassembly" #String that shows the type of object
if not processingTime: if not processingTime:
......
...@@ -45,7 +45,7 @@ class BatchScrapMachine(Machine): ...@@ -45,7 +45,7 @@ class BatchScrapMachine(Machine):
# ======================================================================= # =======================================================================
def __init__(self, id, name, capacity=1, \ def __init__(self, id, name, capacity=1, \
processingTime=None, repairman='None',\ processingTime=None, repairman='None',\
scrapQuantity={}): scrapQuantity={}, **kw):
if not processingTime: if not processingTime:
processingTime = {'distributionType': 'Fixed', processingTime = {'distributionType': 'Fixed',
'mean': 1} 'mean': 1}
......
...@@ -32,7 +32,7 @@ from RandomNumberGenerator import RandomNumberGenerator ...@@ -32,7 +32,7 @@ from RandomNumberGenerator import RandomNumberGenerator
class BatchSource(Source): class BatchSource(Source):
def __init__(self, id, name, interarrivalTime=None, def __init__(self, id, name, interarrivalTime=None,
entity='Dream.Batch', batchNumberOfUnits=1): entity='Dream.Batch', batchNumberOfUnits=1, **kw):
Source.__init__(self, id=id, name=name, Source.__init__(self, id=id, name=name,
interarrivalTime=interarrivalTime, entity=entity) interarrivalTime=interarrivalTime, entity=entity)
self.numberOfUnits = int(batchNumberOfUnits) self.numberOfUnits = int(batchNumberOfUnits)
......
...@@ -34,7 +34,8 @@ from Entity import Entity ...@@ -34,7 +34,8 @@ from Entity import Entity
class CapacityEntity(Entity): class CapacityEntity(Entity):
type="CapacityEntity" type="CapacityEntity"
def __init__(self, id=None, name=None, capacityProjectId=None, requiredCapacity=10, priority=0, dueDate=0, orderDate=0, isCritical=False): def __init__(self, id=None, name=None, capacityProjectId=None, requiredCapacity=10, priority=0, dueDate=0,
orderDate=0, isCritical=False, **kw):
Entity.__init__(self, id, name, priority, dueDate, orderDate, isCritical) Entity.__init__(self, id, name, priority, dueDate, orderDate, isCritical)
self.capacityProjectId=capacityProjectId # the project id hat the capacity Entity is part of self.capacityProjectId=capacityProjectId # the project id hat the capacity Entity is part of
self.capacityProject=None # the project that the capacity Entity is part of. It is defined in initialize self.capacityProject=None # the project that the capacity Entity is part of. It is defined in initialize
......
...@@ -35,7 +35,7 @@ class CapacityProject(Entity): ...@@ -35,7 +35,7 @@ class CapacityProject(Entity):
type="CapacityProject" type="CapacityProject"
def __init__(self, id=None, name=None, capacityRequirementDict={}, earliestStartDict={}, dueDate=0, def __init__(self, id=None, name=None, capacityRequirementDict={}, earliestStartDict={}, dueDate=0,
assemblySpaceRequirement=0): assemblySpaceRequirement=0, **kw):
Entity.__init__(self, id, name, dueDate=dueDate) Entity.__init__(self, id, name, dueDate=dueDate)
# a dict that shows the required capacity from every station # a dict that shows the required capacity from every station
self.capacityRequirementDict=capacityRequirementDict self.capacityRequirementDict=capacityRequirementDict
......
...@@ -40,7 +40,7 @@ class CapacityStation(Queue): ...@@ -40,7 +40,7 @@ class CapacityStation(Queue):
# the __init__ method of the CapacityStation # the __init__ method of the CapacityStation
#=========================================================================== #===========================================================================
def __init__(self, id, name, capacity=float("inf"), intervalCapacity=[], schedulingRule="FIFO", gatherWipStat=False, def __init__(self, id, name, capacity=float("inf"), intervalCapacity=[], schedulingRule="FIFO", gatherWipStat=False,
sharedResources={}): sharedResources={}, **kw):
Queue.__init__(self, id, name, capacity=capacity) Queue.__init__(self, id, name, capacity=capacity)
# a list that holds the capacity (manhours) that is available in each interval # a list that holds the capacity (manhours) that is available in each interval
self.intervalCapacity=intervalCapacity self.intervalCapacity=intervalCapacity
......
...@@ -35,7 +35,8 @@ class CapacityStationBuffer(Queue): ...@@ -35,7 +35,8 @@ class CapacityStationBuffer(Queue):
#=========================================================================== #===========================================================================
# the __init__ method of the CapacityStationBuffer # the __init__ method of the CapacityStationBuffer
#=========================================================================== #===========================================================================
def __init__(self, id, name, requireFullProject =False, capacity=float("inf"), isDummy=False, schedulingRule="FIFO", gatherWipStat=False): def __init__(self, id, name, requireFullProject =False, capacity=float("inf"), isDummy=False,
schedulingRule="FIFO", gatherWipStat=False,**kw):
Queue.__init__(self, id, name, capacity=capacity) Queue.__init__(self, id, name, capacity=capacity)
self.isLocked=True self.isLocked=True
self.requireFullProject=requireFullProject # flag that shows if here the whole project is assembled self.requireFullProject=requireFullProject # flag that shows if here the whole project is assembled
......
...@@ -33,7 +33,8 @@ from Globals import G ...@@ -33,7 +33,8 @@ from Globals import G
class CapacityStationController(EventGenerator): class CapacityStationController(EventGenerator):
def __init__(self, id=id, name=None, start=0, stop=float('inf'), interval=1, def __init__(self, id=id, name=None, start=0, stop=float('inf'), interval=1,
duration=0, method=None, argumentDict=None, dueDateThreshold=float('inf'), prioritizeIfCanFinish=False): duration=0, method=None, argumentDict=None, dueDateThreshold=float('inf'),
prioritizeIfCanFinish=False,**kw):
EventGenerator.__init__(self, id, name, start, stop, interval, EventGenerator.__init__(self, id, name, start, stop, interval,
duration, method, argumentDict) duration, method, argumentDict)
# attribute used by optimization in calculateWhatIsToBeProcessed # attribute used by optimization in calculateWhatIsToBeProcessed
......
...@@ -38,7 +38,7 @@ class CapacityStationExit(Exit): ...@@ -38,7 +38,7 @@ class CapacityStationExit(Exit):
#=========================================================================== #===========================================================================
# the __init__ method of the CapacityStationExit # the __init__ method of the CapacityStationExit
#=========================================================================== #===========================================================================
def __init__(self, id, name=None, nextCapacityStationBufferId=None): def __init__(self, id, name=None, nextCapacityStationBufferId=None,**kw):
Exit.__init__(self, id, name) Exit.__init__(self, id, name)
self.isLocked=True self.isLocked=True
self.nextCapacityStationBufferId=nextCapacityStationBufferId # the id of the next station. If it is None it self.nextCapacityStationBufferId=nextCapacityStationBufferId # the id of the next station. If it is None it
......
...@@ -43,7 +43,7 @@ class ConditionalBuffer(QueueManagedJob): ...@@ -43,7 +43,7 @@ class ConditionalBuffer(QueueManagedJob):
# whereas the default capacity is set to infinity # whereas the default capacity is set to infinity
# ======================================================================= # =======================================================================
def __init__(self, id, name, capacity=-1, isDummy=False, def __init__(self, id, name, capacity=-1, isDummy=False,
schedulingRule="FIFO"): schedulingRule="FIFO",**kw):
QueueManagedJob.__init__(self, id=id, name=name, capacity=capacity, QueueManagedJob.__init__(self, id=id, name=name, capacity=capacity,
isDummy=isDummy, schedulingRule=schedulingRule) isDummy=isDummy, schedulingRule=schedulingRule)
......
...@@ -40,7 +40,7 @@ class Conveyer(CoreObject): ...@@ -40,7 +40,7 @@ class Conveyer(CoreObject):
#=========================================================================== #===========================================================================
# the conveyer __init__ method # the conveyer __init__ method
#=========================================================================== #===========================================================================
def __init__(self, id, name, length, speed): def __init__(self, id, name, length, speed,**kw):
CoreObject.__init__(self, id, name) CoreObject.__init__(self, id, name)
self.type="Conveyer" self.type="Conveyer"
self.speed=float(speed) #the speed of the conveyer in m/sec self.speed=float(speed) #the speed of the conveyer in m/sec
......
...@@ -42,7 +42,7 @@ class Dismantle(CoreObject): ...@@ -42,7 +42,7 @@ class Dismantle(CoreObject):
#=========================================================================== #===========================================================================
# initialize the object # initialize the object
#=========================================================================== #===========================================================================
def __init__(self, id='', name='', processingTime=None): def __init__(self, id='', name='', processingTime=None,**kw):
self.type='Dismantle' self.type='Dismantle'
self.previous=[] #list with the previous objects in the flow self.previous=[] #list with the previous objects in the flow
......
...@@ -35,7 +35,7 @@ class Entity(object): ...@@ -35,7 +35,7 @@ class Entity(object):
type="Entity" type="Entity"
def __init__(self, id=None, name=None, priority=0, dueDate=0, orderDate=0, def __init__(self, id=None, name=None, priority=0, dueDate=0, orderDate=0,
isCritical=False, remainingProcessingTime=0): isCritical=False, remainingProcessingTime=0,**kw):
self.name=name self.name=name
self.id=id self.id=id
# information on the object holding the entity # information on the object holding the entity
......
...@@ -32,7 +32,7 @@ from ObjectInterruption import ObjectInterruption ...@@ -32,7 +32,7 @@ from ObjectInterruption import ObjectInterruption
class EventGenerator(ObjectInterruption): class EventGenerator(ObjectInterruption):
def __init__(self, id=id, name=None, start=0, stop=float('inf'), interval=1, def __init__(self, id=id, name=None, start=0, stop=float('inf'), interval=1,
duration=0, method=None, argumentDict=None): duration=0, method=None, argumentDict=None,**kw):
ObjectInterruption.__init__(self) ObjectInterruption.__init__(self)
self.id=id self.id=id
self.name=name self.name=name
......
...@@ -37,7 +37,7 @@ class Exit(CoreObject): ...@@ -37,7 +37,7 @@ class Exit(CoreObject):
family='Exit' family='Exit'
def __init__(self, id='', name='', inputsDict={}): def __init__(self, id, name, **kw):
self.type="Exit" # XXX needed ? self.type="Exit" # XXX needed ?
#lists to hold statistics of multiple runs #lists to hold statistics of multiple runs
self.Exits=[] self.Exits=[]
......
...@@ -33,15 +33,7 @@ from Exit import Exit ...@@ -33,15 +33,7 @@ from Exit import Exit
# =========================================================================== # ===========================================================================
# the ExitJobShop object # the ExitJobShop object
# =========================================================================== # ===========================================================================
class ExitJobShop(Exit): class ExitJobShop(Exit):
# =======================================================================
# parses inputs if they are given in a dictionary
# =======================================================================
def parseInputs(self, inputsDict):
Exit.parseInputs(self, inputsDict)
from Globals import G
G.ExitJobShopList.append(self)
# ======================================================================= # =======================================================================
# set all the objects in previous # set all the objects in previous
......
...@@ -35,7 +35,7 @@ from ObjectInterruption import ObjectInterruption ...@@ -35,7 +35,7 @@ from ObjectInterruption import ObjectInterruption
class Failure(ObjectInterruption): class Failure(ObjectInterruption):
def __init__(self, victim=None, distribution=None, index=0, repairman=None, offshift=False, def __init__(self, victim=None, distribution=None, index=0, repairman=None, offshift=False,
deteriorationType='constant'): deteriorationType='constant',**kw):
#Process.__init__(self) #Process.__init__(self)
ObjectInterruption.__init__(self,victim) ObjectInterruption.__init__(self,victim)
if distribution: if distribution:
......
...@@ -35,7 +35,7 @@ class Frame(Entity): ...@@ -35,7 +35,7 @@ class Frame(Entity):
type="Frame" type="Frame"
capacity=4 #the number of parts that the frame can take capacity=4 #the number of parts that the frame can take
def __init__(self, id=None, name=None): def __init__(self, id=None, name=None,**kw):
Entity.__init__(self,id=id,name = name) Entity.__init__(self,id=id,name = name)
self.Res=Resource(self.capacity) self.Res=Resource(self.capacity)
......
...@@ -36,7 +36,8 @@ class Job(Entity): # inherits from the Entity c ...@@ -36,7 +36,8 @@ class Job(Entity): # inherits from the Entity c
type='Job' type='Job'
family='Job' family='Job'
def __init__(self, id=None, name=None, route=[], priority=0, dueDate=0, orderDate=0, extraPropertyDict=None,isCritical=False): def __init__(self, id=None, name=None, route=[], priority=0, dueDate=0, orderDate=0,
extraPropertyDict=None,isCritical=False,**kw):
Entity.__init__(self, id=id,name=name, priority=priority, dueDate=dueDate, orderDate=orderDate, isCritical=isCritical) Entity.__init__(self, id=id,name=name, priority=priority, dueDate=dueDate, orderDate=orderDate, isCritical=isCritical)
# instance specific attributes # instance specific attributes
# information on the routing and the stops of the entity # information on the routing and the stops of the entity
......
...@@ -257,16 +257,7 @@ def createObjectResourcesAndCoreObjects(): ...@@ -257,16 +257,7 @@ def createObjectResourcesAndCoreObjects():
from CoreObject import CoreObject from CoreObject import CoreObject
if issubclass(objectType, CoreObject): if issubclass(objectType, CoreObject):
# remove data that has to do with wip or object interruption. CoreObjects do not need it # remove data that has to do with wip or object interruption. CoreObjects do not need it
inputDict=dict(element) inputDict=dict(element)
if 'wip' in inputDict:
del inputDict['wip']
if 'failures' in inputDict:
del inputDict['failures']
if 'shift' in inputDict:
del inputDict['shift']
if 'scheduledMaintenance' in inputDict:
del inputDict['scheduledMaintenance']
# create the CoreObject # create the CoreObject
coreObject=objectType(**inputDict) coreObject=objectType(**inputDict)
# update the nextIDs list of the object # update the nextIDs list of the object
......
...@@ -54,7 +54,7 @@ class Machine(CoreObject): ...@@ -54,7 +54,7 @@ class Machine(CoreObject):
operatorPool='None',operationType='None',\ operatorPool='None',operationType='None',\
setupTime=None, loadTime=None, setupTime=None, loadTime=None,
preemption={}, preemption={},
canDeliverOnInterruption=False): canDeliverOnInterruption=False, **kw):
self.type="Machine" #String that shows the type of object self.type="Machine" #String that shows the type of object
CoreObject.__init__(self, id, name) CoreObject.__init__(self, id, name)
from Globals import G from Globals import G
......
...@@ -31,15 +31,7 @@ from Machine import Machine ...@@ -31,15 +31,7 @@ from Machine import Machine
# the MachineJobShop object # the MachineJobShop object
# =========================================================================== # ===========================================================================
class MachineJobShop(Machine): class MachineJobShop(Machine):
# =======================================================================
# parses inputs if they are given in a dictionary
# =======================================================================
def parseInputs(self, inputsDict):
Machine.parseInputs(self, inputsDict)
from Globals import G
G.MachineJobShopList.append(self)
# ======================================================================= # =======================================================================
# set all the objects in previous and next # set all the objects in previous and next
# ======================================================================= # =======================================================================
......
...@@ -39,14 +39,6 @@ from MachineJobShop import MachineJobShop ...@@ -39,14 +39,6 @@ from MachineJobShop import MachineJobShop
# =========================================================================== # ===========================================================================
class MachineManagedJob(MachineJobShop): class MachineManagedJob(MachineJobShop):
# =======================================================================
# parses inputs if they are given in a dictionary
# =======================================================================
def parseInputs(self, inputsDict):
MachineJobShop.parseInputs(self, inputsDict)
from Globals import G
G.MachineManagedJobList.append(self)
# ======================================================================= # =======================================================================
# initialise the MachineManagedJob # initialise the MachineManagedJob
# ======================================================================= # =======================================================================
......
...@@ -42,7 +42,7 @@ class Mould(Job): # inherits from the Job class ...@@ -42,7 +42,7 @@ class Mould(Job): # inherits from the Job class
orderDate=None, orderDate=None,
extraPropertyDict=None, extraPropertyDict=None,
order=None, order=None,
isCritical=False): isCritical=False,**kw):
Job.__init__(self, id, name, route, priority, dueDate, orderDate, extraPropertyDict, isCritical) Job.__init__(self, id, name, route, priority, dueDate, orderDate, extraPropertyDict, isCritical)
self.order=order # parent order of the order component self.order=order # parent order of the order component
# TODO: in case the order is not given as argument (when the component is given as WIP) have to give a manager as argument # TODO: in case the order is not given as argument (when the component is given as WIP) have to give a manager as argument
......
...@@ -81,8 +81,7 @@ class MouldAssembly(MachineManagedJob): ...@@ -81,8 +81,7 @@ class MouldAssembly(MachineManagedJob):
# ======================================================================= # =======================================================================
# parses inputs if they are given in a dictionary # parses inputs if they are given in a dictionary
# ======================================================================= # =======================================================================
def parseInputs(self, inputsDict): def parseInputs(self, **kw):
MachineManagedJob.parseInputs(self, inputsDict)
from Globals import G from Globals import G
G.MouldAssemblyList.append(self) G.MouldAssemblyList.append(self)
......
...@@ -46,7 +46,7 @@ class MouldAssemblyBuffer(QueueManagedJob): ...@@ -46,7 +46,7 @@ class MouldAssemblyBuffer(QueueManagedJob):
# whereas the default capacity is set to infinity # whereas the default capacity is set to infinity
# ======================================================================= # =======================================================================
def __init__(self, id, name, capacity=-1, isDummy=False, def __init__(self, id, name, capacity=-1, isDummy=False,
schedulingRule="FIFO"): schedulingRule="FIFO",**kw):
QueueManagedJob.__init__(self, id=id, name=name, capacity=capacity, QueueManagedJob.__init__(self, id=id, name=name, capacity=capacity,
isDummy=isDummy, schedulingRule=schedulingRule) isDummy=isDummy, schedulingRule=schedulingRule)
......
...@@ -34,7 +34,7 @@ import simpy ...@@ -34,7 +34,7 @@ import simpy
#=============================================================================== #===============================================================================
class ObjectInterruption(object): class ObjectInterruption(object):
def __init__(self, victim=None): def __init__(self, victim=None,**kw):
self.victim=victim self.victim=victim
# variable used to hand in control to the objectInterruption # variable used to hand in control to the objectInterruption
self.call=False self.call=False
......
...@@ -32,7 +32,7 @@ import simpy ...@@ -32,7 +32,7 @@ import simpy
# =========================================================================== # ===========================================================================
class ObjectResource(object): class ObjectResource(object):
def __init__(self): def __init__(self,**kw):
self.initialized = False self.initialized = False
# list that holds the objectInterruptions that have this element as victim # list that holds the objectInterruptions that have this element as victim
self.objectInterruptions=[] self.objectInterruptions=[]
......
...@@ -37,7 +37,7 @@ from ObjectResource import ObjectResource ...@@ -37,7 +37,7 @@ from ObjectResource import ObjectResource
class Operator(ObjectResource): class Operator(ObjectResource):
family='Operator' family='Operator'
def __init__(self, id, name, capacity=1, schedulingRule='FIFO', skills=[], available=True): def __init__(self, id, name, capacity=1, schedulingRule='FIFO', skills=[], available=True,**kw):
ObjectResource.__init__(self) ObjectResource.__init__(self)
self.id=id self.id=id
self.objName=name self.objName=name
......
...@@ -35,7 +35,7 @@ from Operator import Operator ...@@ -35,7 +35,7 @@ from Operator import Operator
# =========================================================================== # ===========================================================================
class OperatorManagedJob(Operator): class OperatorManagedJob(Operator):
def __init__(self, id, name, capacity=1,schedulingRule="FIFO"): def __init__(self, id, name, capacity=1,schedulingRule="FIFO",**kw):
Operator.__init__(self,id=id,name=name,capacity=capacity,schedulingRule=schedulingRule) Operator.__init__(self,id=id,name=name,capacity=capacity,schedulingRule=schedulingRule)
from Globals import G from Globals import G
G.OperatorManagedJobsList.append(self) G.OperatorManagedJobsList.append(self)
......
...@@ -37,7 +37,7 @@ from Operator import Operator ...@@ -37,7 +37,7 @@ from Operator import Operator
# =========================================================================== # ===========================================================================
class OperatorPool(ObjectResource): class OperatorPool(ObjectResource):
def __init__(self, id, name, capacity=1, operatorsList='None'): def __init__(self, id, name, capacity=1, operatorsList='None',**kw):
capacity = int(capacity or 1) capacity = int(capacity or 1)
......
...@@ -45,7 +45,8 @@ class Order(Job): ...@@ -45,7 +45,8 @@ class Order(Job):
manager=None, manager=None,
basicsEnded=0, basicsEnded=0,
componentsReadyForAssembly=0, componentsReadyForAssembly=0,
extraPropertyDict=None): extraPropertyDict=None,
**kw):
Job. __init__(self, id=id, name=name, route=route, priority=priority, dueDate=dueDate, orderDate=orderDate, Job. __init__(self, id=id, name=name, route=route, priority=priority, dueDate=dueDate, orderDate=orderDate,
extraPropertyDict=extraPropertyDict) extraPropertyDict=extraPropertyDict)
# self.isCritical=isCritical # flag to inform weather the order is critical -> preemption # self.isCritical=isCritical # flag to inform weather the order is critical -> preemption
......
...@@ -44,7 +44,8 @@ class OrderComponent(Job): # inherits from the ...@@ -44,7 +44,8 @@ class OrderComponent(Job): # inherits from the
order=None, order=None,
requestingComponent = None, requestingComponent = None,
readyForAssembly = 0, readyForAssembly = 0,
isCritical=False): isCritical=False,
**kw):
Job.__init__(self, id, name, route, priority, dueDate, orderDate, extraPropertyDict, isCritical) Job.__init__(self, id, name, route, priority, dueDate, orderDate, extraPropertyDict, isCritical)
self.auxiliaryList=[] # Holds the auxiliary components that the component needs for a certain processing self.auxiliaryList=[] # Holds the auxiliary components that the component needs for a certain processing
self.order=order # parent order of the order component self.order=order # parent order of the order component
......
...@@ -43,7 +43,8 @@ class OrderDesign(Job): # inherits from the Job ...@@ -43,7 +43,8 @@ class OrderDesign(Job): # inherits from the Job
extraPropertyDict=None, extraPropertyDict=None,
order=None, order=None,
requestingComponent = None, requestingComponent = None,
isCritical=False): isCritical=False,
**kw):
Job.__init__(self, id, name, route, priority, dueDate, orderDate, extraPropertyDict, isCritical) Job.__init__(self, id, name, route, priority, dueDate, orderDate, extraPropertyDict, isCritical)
self.order=order # parent order of the order component self.order=order # parent order of the order component
# TODO: in case the order is not given as argument (when the component is given as WIP) have to give a manager as argument # TODO: in case the order is not given as argument (when the component is given as WIP) have to give a manager as argument
......
...@@ -33,7 +33,7 @@ from Entity import Entity ...@@ -33,7 +33,7 @@ from Entity import Entity
#The part object #The part object
class Part(Entity): class Part(Entity):
type="Part" type="Part"
def __init__(self, id=None, name=None, remainingProcessingTime=0): def __init__(self, id=None, name=None, remainingProcessingTime=0,**kw):
Entity.__init__(self, id, name, remainingProcessingTime=remainingProcessingTime) Entity.__init__(self, id, name, remainingProcessingTime=remainingProcessingTime)
...@@ -37,7 +37,8 @@ class Queue(CoreObject): ...@@ -37,7 +37,8 @@ class Queue(CoreObject):
#=========================================================================== #===========================================================================
# the __init__ method of the Queue # the __init__ method of the Queue
#=========================================================================== #===========================================================================
def __init__(self, id='', name='', capacity=1, isDummy=False, schedulingRule="FIFO", level=None, gatherWipStat=False, inputsDict={}): def __init__(self, id='', name='', capacity=1, isDummy=False, schedulingRule="FIFO",
level=None, gatherWipStat=False, **kw):
self.type="Queue" # String that shows the type of object self.type="Queue" # String that shows the type of object
CoreObject.__init__(self, id, name) CoreObject.__init__(self, id, name)
capacity=float(capacity) capacity=float(capacity)
......
...@@ -32,15 +32,7 @@ from Queue import Queue ...@@ -32,15 +32,7 @@ from Queue import Queue
# the QueueJobShop object # the QueueJobShop object
# =========================================================================== # ===========================================================================
class QueueJobShop(Queue): class QueueJobShop(Queue):
# =======================================================================
# parses inputs if they are given in a dictionary
# =======================================================================
def parseInputs(self, inputsDict):
Queue.parseInputs(self, inputsDict)
from Globals import G
G.QueueJobShopList.append(self)
# ======================================================================= # =======================================================================
# set all the objects in previous and next # set all the objects in previous and next
# ======================================================================= # =======================================================================
......
...@@ -41,23 +41,13 @@ class NoCallerError(Exception): ...@@ -41,23 +41,13 @@ class NoCallerError(Exception):
# =========================================================================== # ===========================================================================
class QueueManagedJob(QueueJobShop): class QueueManagedJob(QueueJobShop):
def __init__(self, id='', name='', capacity=1, isDummy=False, schedulingRule="FIFO", inputsDict={}): def __init__(self, id, name, capacity=1, isDummy=False, schedulingRule="FIFO", **kw):
if inputsDict: QueueJobShop.__init__(self, id=id, name=name,capacity=capacity, isDummy=isDummy, schedulingRule=schedulingRule)
QueueJobShop.__init__(self,inputsDict=inputsDict)
else:
QueueJobShop.__init__(self, id=id, name=name,capacity=capacity, isDummy=isDummy, schedulingRule=schedulingRule)
# variable used by the sortEntities method # variable used by the sortEntities method
# to identify the object it will be sorting for (manager.checkIfResourceIsAvailable(self.objectSortingFor)) # to identify the object it will be sorting for (manager.checkIfResourceIsAvailable(self.objectSortingFor))
self.objectSortingFor=None self.objectSortingFor=None
# =======================================================================
# parses inputs if they are given in a dictionary
# =======================================================================
def parseInputs(self, inputsDict):
QueueJobShop.parseInputs(self, inputsDict)
from Globals import G
G.QueueManagedJobList.append(self)
# ======================================================================= # =======================================================================
# set all the objects in previous and next # set all the objects in previous and next
# ======================================================================= # =======================================================================
......
...@@ -34,7 +34,7 @@ from Operator import Operator ...@@ -34,7 +34,7 @@ from Operator import Operator
# the resource that repairs the machines # the resource that repairs the machines
# =========================================================================== # ===========================================================================
class Repairman(Operator): class Repairman(Operator):
def __init__(self, id, name, capacity=1): def __init__(self, id, name, capacity=1,**kw):
Operator.__init__(self,id=id, name=name, capacity=capacity) Operator.__init__(self,id=id, name=name, capacity=capacity)
self.type="Repairman" self.type="Repairman"
from Globals import G from Globals import G
......
...@@ -34,14 +34,6 @@ from Queue import Queue ...@@ -34,14 +34,6 @@ from Queue import Queue
# =========================================================================== # ===========================================================================
class RoutingQueue(Queue): class RoutingQueue(Queue):
# =======================================================================
# parses inputs if they are given in a dictionary
# =======================================================================
def parseInputs(self, inputsDict):
Queue.parseInputs(self, inputsDict)
from Globals import G
G.RoutingQueueList.append(self)
# ======================================================================= # =======================================================================
# checks if the Queue can dispose an entity to the following object # checks if the Queue can dispose an entity to the following object
# it checks also who called it and returns TRUE # it checks also who called it and returns TRUE
......
...@@ -38,7 +38,7 @@ class ScheduledMaintenance(ObjectInterruption): ...@@ -38,7 +38,7 @@ class ScheduledMaintenance(ObjectInterruption):
# ======================================================================= # =======================================================================
# the __init__() method of the class # the __init__() method of the class
# ======================================================================= # =======================================================================
def __init__(self, victim=None, start=0, duration=1, endStatus='interrupted'): def __init__(self, victim=None, start=0, duration=1, endStatus='interrupted',**kw):
''' '''
interrupted : the maintenance starts immediately interrupted : the maintenance starts immediately
loaded : the maintenance starts as soon as the victim has ended processing loaded : the maintenance starts as soon as the victim has ended processing
......
...@@ -39,7 +39,7 @@ class ShiftScheduler(ObjectInterruption): ...@@ -39,7 +39,7 @@ class ShiftScheduler(ObjectInterruption):
# ======================================================================= # =======================================================================
# the __init__() method of the class # the __init__() method of the class
# ======================================================================= # =======================================================================
def __init__(self, victim=None, shiftPattern=[], endUnfinished=False, receiveBeforeEndThreshold=0.0): def __init__(self, victim=None, shiftPattern=[], endUnfinished=False, receiveBeforeEndThreshold=0.0,**kw):
ObjectInterruption.__init__(self,victim) ObjectInterruption.__init__(self,victim)
self.type='ShiftScheduler' self.type='ShiftScheduler'
self.shiftPattern=shiftPattern self.shiftPattern=shiftPattern
......
...@@ -78,7 +78,7 @@ class Source(CoreObject): ...@@ -78,7 +78,7 @@ class Source(CoreObject):
#=========================================================================== #===========================================================================
# the __init__method of the Source class # the __init__method of the Source class
#=========================================================================== #===========================================================================
def __init__(self, id, name, interarrivalTime=None, entity='Dream.Part'): def __init__(self, id, name, interarrivalTime=None, entity='Dream.Part',**kw):
# Default values # Default values
if not interarrivalTime: if not interarrivalTime:
interarrivalTime = {'distributionType': 'Fixed', 'mean': 1} interarrivalTime = {'distributionType': 'Fixed', 'mean': 1}
......
...@@ -32,7 +32,7 @@ class SubBatch(Entity): ...@@ -32,7 +32,7 @@ class SubBatch(Entity):
type="SubBatch" type="SubBatch"
def __init__(self, id, name, numberOfUnits=1, parentBatch=None, parentBatchName=None, parentBatchId=None, def __init__(self, id, name, numberOfUnits=1, parentBatch=None, parentBatchName=None, parentBatchId=None,
remainingProcessingTime=0, unitsToProcess=0): remainingProcessingTime=0, unitsToProcess=0,**kw):
Entity.__init__(self, name=name, id=id, remainingProcessingTime=remainingProcessingTime) Entity.__init__(self, name=name, id=id, remainingProcessingTime=remainingProcessingTime)
self.numberOfUnits=int(numberOfUnits) self.numberOfUnits=int(numberOfUnits)
self.parentBatch=parentBatch self.parentBatch=parentBatch
......
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