Commit f42a545a authored by Georgios Dagkakis's avatar Georgios Dagkakis

Entity types can receive currentStation also in creation

parent bb1ebfcb
...@@ -34,8 +34,10 @@ from SubBatch import SubBatch ...@@ -34,8 +34,10 @@ 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, **kw): def __init__(self, id, name, numberOfUnits=1, currentStation=None,
Entity.__init__(self, name=name, id=id, remainingProcessingTime=remainingProcessingTime) remainingProcessingTime=0, unitsToProcess=0, **kw):
Entity.__init__(self, name=name, id=id, remainingProcessingTime=remainingProcessingTime,
currentStation=currentStation)
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
self.subBatchList=[] #list that contains the sub-batches that this batch has been broken into self.subBatchList=[] #list that contains the sub-batches that this batch has been broken into
......
...@@ -35,8 +35,8 @@ class CapacityEntity(Entity): ...@@ -35,8 +35,8 @@ class CapacityEntity(Entity):
type="CapacityEntity" type="CapacityEntity"
def __init__(self, id=None, name=None, capacityProjectId=None, requiredCapacity=10, priority=0, dueDate=0, def __init__(self, id=None, name=None, capacityProjectId=None, requiredCapacity=10, priority=0, dueDate=0,
orderDate=0, isCritical=False, **kw): orderDate=0, currentStation=None, isCritical=False, **kw):
Entity.__init__(self, id, name, priority, dueDate, orderDate, isCritical) Entity.__init__(self, id, name, priority, dueDate, orderDate, isCritical, currentStation=currentStation)
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
self.requiredCapacity=requiredCapacity # the capacity that the capacity entity requires from the following station self.requiredCapacity=requiredCapacity # the capacity that the capacity entity requires from the following station
......
...@@ -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,**kw): isCritical=False, remainingProcessingTime=0,currentStation=None,**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
...@@ -54,7 +54,7 @@ class Entity(object): ...@@ -54,7 +54,7 @@ class Entity(object):
# a list that holds information about the schedule # a list that holds information about the schedule
# of the entity (when it enters and exits every station) # of the entity (when it enters and exits every station)
self.schedule=[] self.schedule=[]
self.currentStation=None self.currentStation=currentStation
# values to be used in the internal processing of compoundObjects # values to be used in the internal processing of compoundObjects
self.internal = False # informs if the entity is being processed internally self.internal = False # informs if the entity is being processed internally
if isinstance(isCritical, unicode): if isinstance(isCritical, unicode):
...@@ -75,6 +75,7 @@ class Entity(object): ...@@ -75,6 +75,7 @@ class Entity(object):
# alias used for printing the Route # alias used for printing the Route
self.alias=None self.alias=None
self.remainingProcessingTime=remainingProcessingTime self.remainingProcessingTime=remainingProcessingTime
# the current station of the entity
# ======================================================================= # =======================================================================
# outputs results to JSON File # outputs results to JSON File
......
...@@ -5,7 +5,7 @@ from dream.simulation.Globals import runSimulation, G ...@@ -5,7 +5,7 @@ from dream.simulation.Globals import runSimulation, G
Q=Queue('Q1','Queue', capacity=1) Q=Queue('Q1','Queue', capacity=1)
M=Machine('M1','Machine', processingTime={'distributionType':'Fixed','mean':0.25}) M=Machine('M1','Machine', processingTime={'distributionType':'Fixed','mean':0.25})
E=Exit('E1','Exit') E=Exit('E1','Exit')
P1=Part('P1', 'Part1') P1=Part('P1', 'Part1', currentStation=Q)
# set the current station # set the current station
P1.currentStation=Q P1.currentStation=Q
......
...@@ -37,8 +37,9 @@ class Job(Entity): # inherits from the Entity c ...@@ -37,8 +37,9 @@ class Job(Entity): # inherits from the Entity c
family='Job' family='Job'
def __init__(self, id=None, name=None, route=[], priority=0, dueDate=0, orderDate=0, def __init__(self, id=None, name=None, route=[], priority=0, dueDate=0, orderDate=0,
extraPropertyDict=None,isCritical=False,**kw): extraPropertyDict=None,currentStation=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,
currentStation=currentStation, 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
self.route=route # the route that the job follows, self.route=route # the route that the job follows,
......
...@@ -38,12 +38,14 @@ class Mould(Job): # inherits from the Job class ...@@ -38,12 +38,14 @@ class Mould(Job): # inherits from the Job class
name=None, name=None,
route=[], route=[],
priority=0, priority=0,
dueDate=None, dueDate=0,
orderDate=None, orderDate=0,
extraPropertyDict=None, extraPropertyDict=None,
order=None, order=None,
currentStation=None,
isCritical=False,**kw): isCritical=False,**kw):
Job.__init__(self, id, name, route, priority, dueDate, orderDate, extraPropertyDict, isCritical) Job.__init__(self, id, name, route=route, priority=priority, dueDate=dueDate, orderDate=orderDate,
extraPropertyDict=extraPropertyDict, isCritical=isCritical,currentStation=currentStation)
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
# or create the initiate the parent order not as WIP # or create the initiate the parent order not as WIP
......
...@@ -45,8 +45,11 @@ class OrderComponent(Job): # inherits from the ...@@ -45,8 +45,11 @@ class OrderComponent(Job): # inherits from the
requestingComponent = None, requestingComponent = None,
readyForAssembly = 0, readyForAssembly = 0,
isCritical=False, isCritical=False,
currentStation=None,
**kw): **kw):
Job.__init__(self, id, name, route, priority, dueDate, orderDate, extraPropertyDict, isCritical) Job.__init__(self, id, name, route=route, priority=priority, dueDate=dueDate,
orderDate=orderDate, extraPropertyDict=extraPropertyDict, isCritical=isCritical,
currentStation=currentStation)
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
# 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,**kw): def __init__(self, id=None, name=None, remainingProcessingTime=0,currentStation=None,**kw):
Entity.__init__(self, id, name, remainingProcessingTime=remainingProcessingTime) Entity.__init__(self, id, name, remainingProcessingTime=remainingProcessingTime,currentStation=currentStation)
...@@ -32,8 +32,9 @@ class SubBatch(Entity): ...@@ -32,8 +32,9 @@ 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,**kw): remainingProcessingTime=0, currentStation=None, unitsToProcess=0,**kw):
Entity.__init__(self, name=name, id=id, remainingProcessingTime=remainingProcessingTime) Entity.__init__(self, name=name, id=id, remainingProcessingTime=remainingProcessingTime,
currentStation=currentStation)
self.numberOfUnits=int(numberOfUnits) self.numberOfUnits=int(numberOfUnits)
self.parentBatch=parentBatch self.parentBatch=parentBatch
self.unitsToProcess=int(unitsToProcess) self.unitsToProcess=int(unitsToProcess)
......
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