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

CapacityObjects to handle lists smoother

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