clean-up

parent 245b8ef7
...@@ -179,8 +179,6 @@ class BatchDecomposition(CoreObject): ...@@ -179,8 +179,6 @@ class BatchDecomposition(CoreObject):
activeObjectQueue.append(subBatch) #append the sub-batch to the active object Queue activeObjectQueue.append(subBatch) #append the sub-batch to the active object Queue
activeEntity.subBatchList.append(subBatch) activeEntity.subBatchList.append(subBatch)
subBatch.currentStation=self subBatch.currentStation=self
# if the activeEntity is hot then the subBatches should be also hot
subBatch.hot=activeEntity.hot
# if the activeEntity is in the pendingEntities list then place the subBatches there # if the activeEntity is in the pendingEntities list then place the subBatches there
if activeEntity in G.pendingEntities: if activeEntity in G.pendingEntities:
G.pendingEntities.append(subBatch) G.pendingEntities.append(subBatch)
......
...@@ -57,9 +57,6 @@ class Entity(object): ...@@ -57,9 +57,6 @@ class Entity(object):
self.isCritical=isCritical # flag to inform weather the entity is critical -> preemption self.isCritical=isCritical # flag to inform weather the entity is critical -> preemption
self.manager=None # default value self.manager=None # default value
self.numberOfUnits=1 # default value self.numberOfUnits=1 # default value
# flag that signalizes that an entity is ready to enter a machine
# gets cold by the time it has finished its processing
self.hot=False
# variable used to differentiate entities with and entities without routes # variable used to differentiate entities with and entities without routes
self.family='Entity' self.family='Entity'
...@@ -78,7 +75,7 @@ class Entity(object): ...@@ -78,7 +75,7 @@ class Entity(object):
def canProceed(self): def canProceed(self):
activeObject=self.currentStation activeObject=self.currentStation
return activeObject.canDeliver(self) return activeObject.canDeliver(self)
#=========================================================================== #===========================================================================
# method that finds a receiver for a candidate entity # method that finds a receiver for a candidate entity
#=========================================================================== #===========================================================================
...@@ -103,26 +100,7 @@ class Entity(object): ...@@ -103,26 +100,7 @@ class Entity(object):
if not self in router.conflictingEntities: if not self in router.conflictingEntities:
router.conflictingEntities.append(self) router.conflictingEntities.append(self)
return availableReceiver return availableReceiver
#===========================================================================
# assign the entity to a station
#===========================================================================
def assignTo(self, object=None):
self.receiver=object
self.timeOfAssignement=now()
#===========================================================================
# unassign the entity from the object it is currently assigned to
#===========================================================================
def unassign(self):
self.receiver=None
self.timeOfAssignement=0
#===========================================================================
# returns the object the entity is currently assigned to
#===========================================================================
def isAssignedTo(self):
return self.receiver
# ======================================================================= # =======================================================================
# outputs results to JSON File # outputs results to JSON File
# ======================================================================= # =======================================================================
......
...@@ -91,7 +91,6 @@ class Exit(CoreObject): ...@@ -91,7 +91,6 @@ class Exit(CoreObject):
# get the active object and its internal queue # get the active object and its internal queue
activeObject=self.getActiveObject() activeObject=self.getActiveObject()
activeObjectQueue=self.getActiveObjectQueue() activeObjectQueue=self.getActiveObjectQueue()
# giverObject=activeObject.getGiverObject()
giverObject=callerObject giverObject=callerObject
assert giverObject, 'there must be a caller for canAcceptAndIsRequested' assert giverObject, 'there must be a caller for canAcceptAndIsRequested'
return giverObject.haveToDispose(self) return giverObject.haveToDispose(self)
...@@ -105,13 +104,15 @@ class Exit(CoreObject): ...@@ -105,13 +104,15 @@ class Exit(CoreObject):
from Globals import G from Globals import G
if activeEntity in G.pendingEntities: if activeEntity in G.pendingEntities:
G.pendingEntities.remove(activeEntity) G.pendingEntities.remove(activeEntity)
if activeEntity in G.EntityList:
G.EntityList.remove(activeEntity)
self.totalLifespan+=now()-activeEntity.startTime #Add the entity's lifespan to the total one. self.totalLifespan+=now()-activeEntity.startTime #Add the entity's lifespan to the total one.
self.numOfExits+=1 # increase the exits by one self.numOfExits+=1 # increase the exits by one
self.totalNumberOfUnitsExited+=activeEntity.numberOfUnits # add the number of units that xited self.totalNumberOfUnitsExited+=activeEntity.numberOfUnits # add the number of units that xited
self.totalTaktTime+=now()-self.timeLastEntityLeft # add the takt time self.totalTaktTime+=now()-self.timeLastEntityLeft # add the takt time
self.timeLastEntityLeft=now() # update the time that the last entity left from the Exit self.timeLastEntityLeft=now() # update the time that the last entity left from the Exit
activeObjectQueue=self.getActiveObjectQueue() activeObjectQueue=self.getActiveObjectQueue()
del activeObjectQueue[:] del self.Res.activeQ[:]
return activeEntity return activeEntity
#=========================================================================== #===========================================================================
......
...@@ -161,24 +161,6 @@ class Source(CoreObject): ...@@ -161,24 +161,6 @@ class Source(CoreObject):
activeEntity=entity activeEntity=entity
# at the newly created entity to the pendingEntities # at the newly created entity to the pendingEntities
G.pendingEntities.append(activeEntity) G.pendingEntities.append(activeEntity)
# TODO: if the successor of the object is a machine that is operated with operationType 'Load'
# then the flag hot of the activeEntity must be set to True
# to signalize that the entity has reached its final destination before the next Machine
# if the entity is not of type Job
if activeEntity.family=='Entity':
successorsAreMachines=True
# for all the objects in the next list
for object in self.next:
# if the object is not in the MachineList
# TODO: We must consider also the case that entities can be blocked before they can reach
# the heating point. In such a case they must be removed from the G.pendingEntities list
# and added again after they are unblocked
if not object in G.MachineList:
successorsAreMachines=False
break
# the hot flag should not be raised
if successorsAreMachines:
activeEntity.hot = True
#============================================================================ #============================================================================
# sets the routing out element for the Source # sets the routing out element for the Source
......
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