Commit 0963f6f3 authored by Georgios Dagkakis's avatar Georgios Dagkakis

CapacityObjects to handle lists smoother

parent 0eba053a
...@@ -42,7 +42,11 @@ class CapacityEntity(Entity): ...@@ -42,7 +42,11 @@ class CapacityEntity(Entity):
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
self.shouldMove=False self.shouldMove=False
from dream.simulation.Globals import G from dream.simulation.Globals import G
G.CapacityEntityList.append(self) if hasattr(G, 'CapacityEntityList'):
G.CapacityEntityList.append(self)
else:
G.CapacityEntityList=[]
G.CapacityEntityList.append(self)
def initialize(self): def initialize(self):
Entity.initialize(self) Entity.initialize(self)
......
...@@ -44,7 +44,11 @@ class CapacityProject(Entity): ...@@ -44,7 +44,11 @@ class CapacityProject(Entity):
# the assembly space the project requires # the assembly space the project requires
self.assemblySpaceRequirement=assemblySpaceRequirement self.assemblySpaceRequirement=assemblySpaceRequirement
from dream.simulation.Globals import G from dream.simulation.Globals import G
G.CapacityProjectList.append(self) if hasattr(G, 'CapacityProjectList'):
G.CapacityProjectList.append(self)
else:
G.CapacityProjectList=[]
G.CapacityProjectList.append(self)
def initialize(self): def initialize(self):
self.projectSchedule=[] # a list of dicts to keep the schedule self.projectSchedule=[] # a list of dicts to keep the schedule
......
...@@ -74,7 +74,11 @@ class CapacityStation(Queue): ...@@ -74,7 +74,11 @@ class CapacityStation(Queue):
self.utilisationDict=[] # a list of dicts for the utilization results self.utilisationDict=[] # a list of dicts for the utilization results
self.detailedWorkPlan=[] # a list of dicts to keep detailed data self.detailedWorkPlan=[] # a list of dicts to keep detailed data
from dream.simulation.Globals import G from dream.simulation.Globals import G
G.CapacityStationList.append(self) if hasattr(G, 'CapacityStationList'):
G.CapacityStationList.append(self)
else:
G.CapacityStationList=[]
G.CapacityStationList.append(self)
def canAccept(self, callerObject=None): def canAccept(self, callerObject=None):
if self.isLocked: if self.isLocked:
......
...@@ -41,7 +41,11 @@ class CapacityStationBuffer(Queue): ...@@ -41,7 +41,11 @@ class CapacityStationBuffer(Queue):
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
from dream.simulation.Globals import G from dream.simulation.Globals import G
G.CapacityStationBufferList.append(self) if hasattr(G, 'CapacityStationBufferList'):
G.CapacityStationBufferList.append(self)
else:
G.CapacityStationBufferList=[]
G.CapacityStationBufferList.append(self)
self.notRequiredOperations=notRequiredOperations # operations that are not required to be assembled self.notRequiredOperations=notRequiredOperations # operations that are not required to be assembled
......
...@@ -45,8 +45,12 @@ class CapacityStationExit(Exit): ...@@ -45,8 +45,12 @@ class CapacityStationExit(Exit):
# means it is the end of the system. # means it is the end of the system.
self.nextCapacityStationBuffer=None # the next buffer. If it is None it self.nextCapacityStationBuffer=None # the next buffer. If it is None it
from dream.simulation.Globals import G from dream.simulation.Globals import G
G.CapacityStationExitList.append(self) if hasattr(G, 'CapacityStationExitList'):
# means it is the end of the system. G.CapacityStationExitList.append(self)
else:
G.CapacityStationExitList=[]
G.CapacityStationExitList.append(self)
def initialize(self): def initialize(self):
Exit.initialize(self) Exit.initialize(self)
self.isLocked=True self.isLocked=True
......
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