Commit 6b7523f9 authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Jérome Perrin

checkIfRequiredPartsReady introduced to Entity. If no sequence is defined then...

checkIfRequiredPartsReady introduced to Entity. If no sequence is defined then the method returns True (for Jobs)
parent 66b46061
......@@ -65,6 +65,7 @@ class ConditionalBuffer(QueueJobShop):
if activeEntity in requiredParts:
# if the entity that requires the activeEntity can proceed then signal the currentStation of the entity
if entity.checkIfRequiredPartsReady():
entity.mayProceed=True
self.sendSignal(receiver=entity.currentStation, signal=entity.currentStation.canDispose)
return activeEntity
......
......@@ -94,4 +94,10 @@ class Entity(ManPyObject):
#===========================================================================
def printRoute(self):
pass
#===========================================================================
# method not implemented yet
#===========================================================================
def checkIfRequiredPartsReady(self):
return True
\ No newline at end of file
......@@ -135,6 +135,9 @@ class Job(Entity): # inherits from the Entity c
def checkIfRequiredPartsReady(self):
# find the sequence of the next step in the route of the activeEntity
sequence=self.nextStepSequence()
# if no sequence is provided then return true
if sequence=='not available':
return True
# assert that the sequence is not zero
assert sequence, "the route sequence of the conditionalBuffer successor cannot be zero"
# flag that decides if the entity can proceed to the next station in its route
......@@ -194,7 +197,7 @@ class Job(Entity): # inherits from the Entity c
#===========================================================================
def nextStepSequence(self):
# find the sequence of the next step in the route of the activeEntity
sequence=self.remainingRoute[0].get('sequence',0)
sequence=self.remainingRoute[0].get('sequence','not available')
return sequence
#===========================================================================
......
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