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
class Batch(Entity):
type="Batch"
def __init__(self, id, name, numberOfUnits=1, remainingProcessingTime=0, unitsToProcess=0, **kw):
Entity.__init__(self, name=name, id=id, remainingProcessingTime=remainingProcessingTime)
def __init__(self, id, name, numberOfUnits=1, currentStation=None,
remainingProcessingTime=0, unitsToProcess=0, **kw):
Entity.__init__(self, name=name, id=id, remainingProcessingTime=remainingProcessingTime,
currentStation=currentStation)
self.numberOfUnits=int(numberOfUnits)
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
......
......@@ -35,8 +35,8 @@ class CapacityEntity(Entity):
type="CapacityEntity"
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)
orderDate=0, currentStation=None, isCritical=False, **kw):
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.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
......
......@@ -35,7 +35,7 @@ class Entity(object):
type="Entity"
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.id=id
# information on the object holding the entity
......@@ -54,7 +54,7 @@ class Entity(object):
# a list that holds information about the schedule
# of the entity (when it enters and exits every station)
self.schedule=[]
self.currentStation=None
self.currentStation=currentStation
# values to be used in the internal processing of compoundObjects
self.internal = False # informs if the entity is being processed internally
if isinstance(isCritical, unicode):
......@@ -75,7 +75,8 @@ class Entity(object):
# alias used for printing the Route
self.alias=None
self.remainingProcessingTime=remainingProcessingTime
# the current station of the entity
# =======================================================================
# outputs results to JSON File
# =======================================================================
......
......@@ -5,7 +5,7 @@ from dream.simulation.Globals import runSimulation, G
Q=Queue('Q1','Queue', capacity=1)
M=Machine('M1','Machine', processingTime={'distributionType':'Fixed','mean':0.25})
E=Exit('E1','Exit')
P1=Part('P1', 'Part1')
P1=Part('P1', 'Part1', currentStation=Q)
# set the current station
P1.currentStation=Q
......
......@@ -37,8 +37,9 @@ class Job(Entity): # inherits from the Entity c
family='Job'
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)
extraPropertyDict=None,currentStation=None, isCritical=False,**kw):
Entity.__init__(self, id=id,name=name, priority=priority, dueDate=dueDate,
currentStation=currentStation, orderDate=orderDate, isCritical=isCritical)
# instance specific attributes
# information on the routing and the stops of the entity
self.route=route # the route that the job follows,
......
......@@ -38,12 +38,14 @@ class Mould(Job): # inherits from the Job class
name=None,
route=[],
priority=0,
dueDate=None,
orderDate=None,
dueDate=0,
orderDate=0,
extraPropertyDict=None,
order=None,
currentStation=None,
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
# 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
......
......@@ -45,8 +45,11 @@ class OrderComponent(Job): # inherits from the
requestingComponent = None,
readyForAssembly = 0,
isCritical=False,
currentStation=None,
**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.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
......
......@@ -33,7 +33,7 @@ from Entity import Entity
#The part object
class Part(Entity):
type="Part"
def __init__(self, id=None, name=None, remainingProcessingTime=0,**kw):
Entity.__init__(self, id, name, remainingProcessingTime=remainingProcessingTime)
def __init__(self, id=None, name=None, remainingProcessingTime=0,currentStation=None,**kw):
Entity.__init__(self, id, name, remainingProcessingTime=remainingProcessingTime,currentStation=currentStation)
......@@ -32,8 +32,9 @@ class SubBatch(Entity):
type="SubBatch"
def __init__(self, id, name, numberOfUnits=1, parentBatch=None, parentBatchName=None, parentBatchId=None,
remainingProcessingTime=0, unitsToProcess=0,**kw):
Entity.__init__(self, name=name, id=id, remainingProcessingTime=remainingProcessingTime)
remainingProcessingTime=0, currentStation=None, unitsToProcess=0,**kw):
Entity.__init__(self, name=name, id=id, remainingProcessingTime=remainingProcessingTime,
currentStation=currentStation)
self.numberOfUnits=int(numberOfUnits)
self.parentBatch=parentBatch
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