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