Commit 274f5afd authored by Georgios Dagkakis's avatar Georgios Dagkakis

objects to read assembly space information

parent f1e0669f
......@@ -34,12 +34,15 @@ from Entity import Entity
class CapacityProject(Entity):
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):
Entity.__init__(self, id, name, dueDate=dueDate)
# a dict that shows the required capacity from every station
self.capacityRequirementDict=capacityRequirementDict
# a dict that shows the earliest start in every station
self.earliestStartDict=earliestStartDict
# the assembly space the project requires
self.assemblySpaceRequirement=assemblySpaceRequirement
def initialize(self):
self.projectSchedule=[] # a list of dicts to keep the schedule
......
......@@ -42,6 +42,8 @@ class CapacityStationController(EventGenerator):
self.dueDateThreshold=dueDateThreshold
# attribute that shows if we prioritize entities that can finish work in this station in the next interval
self.prioritizeIfCanFinish=prioritizeIfCanFinish
# the total assemblySpace in the system
self.assemblySpace=float(G.extraPropertyDict.get('assemblySpace', float('inf')))
def initialize(self):
EventGenerator.initialize(self)
......
......@@ -116,7 +116,9 @@ def readGeneralInput():
G.trace=general.get('trace', 'No') # get trace in order to check if trace is requested
G.console=general.get('console', 'No') # get console flag in order to check if console print is requested
G.confidenceLevel=float(general.get('confidenceLevel', '0.95')) # get the confidence level
G.seed = general.get('seed')
G.seed = general.get('seed') # the seed for random number generation
G.extraPropertyDict=general.get('extraPropertyDict', {}) # a dict to put extra properties that are
# generic for the model
# ===========================================================================
# creates the simulation objects
......@@ -1269,8 +1271,11 @@ def createWIP():
capacityRequirementDict=entity.get('capacityRequirementDict', {})
earliestStartDict=entity.get('earliestStartDict', {})
dueDate=float(entity.get('dueDate', 0))
assemblySpaceRequirement=float(entity.get('assemblySpaceRequirement', 0))
CP=CapacityProject(id=id, name=name, capacityRequirementDict=capacityRequirementDict,
earliestStartDict=earliestStartDict, dueDate=dueDate)
earliestStartDict=earliestStartDict, dueDate=dueDate,
assemblySpaceRequirement=assemblySpaceRequirement)
G.EntityList.append(CP)
G.CapacityProjectList.append(CP)
......
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