Commit 9a18397c authored by Jérome Perrin's avatar Jérome Perrin

Entity: assign self.id in parent class

parent 30587d5d
......@@ -34,10 +34,9 @@ class Batch(Entity):
def __init__(self, id, name, numberOfUnits=1):
Entity.__init__(self, name=name)
self.id=id
self.numberOfUnits=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
\ No newline at end of file
......@@ -38,4 +38,3 @@ class CapacityProject(Entity):
Entity.__init__(self, id, name)
# a dict that shows the required capacity from every station
self.capacityRequirementDict=capacityRequirementDict
self.id=id
......@@ -36,6 +36,7 @@ class Entity(object):
def __init__(self, id=None, name=None, priority=0, dueDate=None, orderDate=None, isCritical=False):
self.name=name
self.id=id
# information on the object holding the entity
# initialized as None and updated every time an entity enters a new object
# information on the lifespan of the entity
......@@ -76,4 +77,4 @@ class Entity(object):
# initializes all the Entity for a new simulation replication
# =======================================================================
def initialize(self):
pass
\ No newline at end of file
pass
......@@ -38,7 +38,6 @@ class Job(Entity): # inherits from the Entity c
def __init__(self, id=None, name=None, route=[], priority=0, dueDate=None, orderDate=None, extraPropertyDict=None,isCritical=False):
Entity.__init__(self, id=id,name=name, priority=priority, dueDate=dueDate, orderDate=orderDate, isCritical=isCritical)
# instance specific attributes
self.id=id # id
# information on the routing and the stops of the entity
self.route=route # the route that the job follows,
# also contains the processing times in each station
......
......@@ -32,9 +32,6 @@ from Entity import Entity
#The part object
class Part(Entity):
class Part(Entity):
type="Part"
def __init__(self, id = None, name = None):
Entity.__init__(self, id = id, name = name)
......@@ -33,7 +33,6 @@ class SubBatch(Entity):
def __init__(self, id, name, numberOfUnits=1, parentBatch=None):
Entity.__init__(self, name=name)
self.id=id
self.numberOfUnits=numberOfUnits
self.parentBatch=parentBatch
self.batchId=parentBatch.id
......
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