Commit 61845c5c authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Georgios Dagkakis

new attribute/argument added to Machine - canDeliverOnInterruption. In case of...

new attribute/argument added to Machine - canDeliverOnInterruption. In case of interruption when the machine has ended processing before delivering, there may be a need to empty the station before the interruption
parent 24990469
......@@ -293,6 +293,7 @@ def createObjects():
id=element.get('id', 'not found')
name=element.get('name', 'not found')
processingTime=element.get('processingTime',{})
canDeliverOnInterruption=bool(element.get('canDeliverOnInterruption') or 0)
failures=element.get('failures', {})
failureDistribution=failures.get('failureDistribution', 'not found')
MTTF=float(failures.get('MTTF') or 0)
......@@ -333,7 +334,8 @@ def createObjects():
operatorPool=machineOperatorPoolList, operationType=operationType,
setupTime=setupTime,
loadTime=loadTime,
repairman=r, isPreemptive=isPreemptive, resetOnPreemption=resetOnPreemption)
repairman=r, isPreemptive=isPreemptive, resetOnPreemption=resetOnPreemption,
canDeliverOnInterruption=canDeliverOnInterruption)
M.nextIds=getSuccessorList(id) # update the nextIDs list of the machine
G.MachineList.append(M) # add machine to global MachineList
if M.operatorPool!="None":
......
......@@ -53,7 +53,8 @@ class Machine(CoreObject):
failureDistribution='No', MTTF=0, MTTR=0, availability=0, repairman='None',\
operatorPool='None',operationType='None',\
setupTime=None, loadTime=None,
isPreemptive=False, resetOnPreemption=False):
isPreemptive=False, resetOnPreemption=False,
canDeliverOnInterruption=False):
CoreObject.__init__(self, id, name)
self.type="Machine" #String that shows the type of object
......@@ -125,6 +126,8 @@ class Machine(CoreObject):
self.resetOnPreemption=resetOnPreemption
# flag notifying that there is operator assigned to the actievObject
self.assignedOperator=True
# flag notifying the the station can deliver entities that ended their processing while interrupted
self.canDeliverOnInterruption=canDeliverOnInterruption
# =======================================================================
# initialize the machine
......@@ -816,11 +819,13 @@ class Machine(CoreObject):
activeObjectQueue=self.Res.users
#if we have only one successor just check if machine waits to dispose and also is up
# this is done to achieve better (cpu) processing time
if(len(self.next)==1 or callerObject==None):
return len(activeObjectQueue)>0 and self.waitToDispose and self.checkIfActive()
if(callerObject==None):
return len(activeObjectQueue)>0 and self.waitToDispose and (self.canDeliverOnInterruption or self.checkIfActive())
thecaller=callerObject
return len(activeObjectQueue)>0 and self.waitToDispose\
and self.checkIfActive() and (thecaller in self.next)
return len(activeObjectQueue)>0\
and self.waitToDispose\
and (thecaller in self.next)\
and (self.canDeliverOnInterruption or self.checkIfActive())
# =======================================================================
# calculates the setup time
......
......@@ -163,7 +163,6 @@ class SkilledRouter(Router):
except:
# XXX what happens in the case of sources or infinite-capacity-queues
pass
print station.id, station.wip
# predecessor.remainingWip=len(predecessor.getActiveObjectQueue()) % nextNo
# for buffer in G.QueueList:
# if buffer.remainingWip:
......
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