Commit 2e97a98e authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Sebastien Robin

Machine postProcessing method changed to accomodate better machines with multiple connections

parent 351faa1e
...@@ -280,14 +280,20 @@ class Machine(CoreObject): ...@@ -280,14 +280,20 @@ class Machine(CoreObject):
#actions to be taken after the simulation ends #actions to be taken after the simulation ends
def postProcessing(self, MaxSimtime): def postProcessing(self, MaxSimtime):
alreadyAdded=False #a flag that shows if the blockage time has already been added alreadyAdded=False #a flag that shows if the blockage time has already been added
#checks all the successors. If no one can accept an Entity then the machine might be blocked
mightBeBlocked=True
for nextObject in self.next:
if nextObject.canAccept():
mightBeBlocked=False
#if there is an entity that finished processing in a Machine but did not get to reach #if there is an entity that finished processing in a Machine but did not get to reach
#the following Object #the following Object
#till the end of simulation, we have to add this blockage to the percentage of blockage in Machine #till the end of simulation, we have to add this blockage to the percentage of blockage in Machine
#we should exclude the failure time in current entity though! #we should exclude the failure time in current entity though!
if (len(self.Res.activeQ)>0) and (len(self.next[0].Res.activeQ)>0) and ((self.nameLastEntityEntered == self.nameLastEntityEnded)): #if (len(self.Res.activeQ)>0) and (len(self.next[0].Res.activeQ)>0) and ((self.nameLastEntityEntered == self.nameLastEntityEnded)):
if (len(self.Res.activeQ)>0) and (mightBeBlocked) and ((self.nameLastEntityEntered == self.nameLastEntityEnded)):
self.totalBlockageTime+=now()-(self.timeLastEntityEnded+self.downTimeInTryingToReleaseCurrentEntity) self.totalBlockageTime+=now()-(self.timeLastEntityEnded+self.downTimeInTryingToReleaseCurrentEntity)
if self.Up==False: if self.Up==False:
self.totalBlockageTime-=now()-self.timeLastFailure self.totalBlockageTime-=now()-self.timeLastFailure
...@@ -305,8 +311,9 @@ class Machine(CoreObject): ...@@ -305,8 +311,9 @@ class Machine(CoreObject):
if(self.Up==False): if(self.Up==False):
self.totalFailureTime+=now()-self.timeLastFailure self.totalFailureTime+=now()-self.timeLastFailure
#we add the value only if it hasn't already been added #we add the value only if it hasn't already been added
if((len(self.next[0].Res.activeQ)>0) and (self.nameLastEntityEnded==self.nameLastEntityEntered) and (not alreadyAdded)): #if((len(self.next[0].Res.activeQ)>0) and (self.nameLastEntityEnded==self.nameLastEntityEntered) and (not alreadyAdded)):
#self.totalBlockageTime+=self.timeLastFailure-self.timeLastEntityEnded if((self.nameLastEntityEnded==self.nameLastEntityEntered) and (not alreadyAdded)):
print "in"
self.totalBlockageTime+=(now()-self.timeLastEntityEnded)-(now()-self.timeLastFailure)-self.downTimeInTryingToReleaseCurrentEntity self.totalBlockageTime+=(now()-self.timeLastEntityEnded)-(now()-self.timeLastFailure)-self.downTimeInTryingToReleaseCurrentEntity
#Machine was idle when it was not in any other state #Machine was idle when it was not in any other state
......
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