Commit d5284a09 authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Georgios Dagkakis

new method responsibleForCurrentStep that return the worker responsible for...

new method responsibleForCurrentStep that return the worker responsible for the current (next) station step in the route of an Job
parent 525edcba
......@@ -76,6 +76,12 @@ class Entity(ManPyObject):
self.alias=None
self.remainingProcessingTime=remainingProcessingTime
# the current station of the entity
#===========================================================================
# return the responsible operator for the current step, not implemented for entities
#===========================================================================
def responsibleForCurrentStep(self):
return None
# =======================================================================
# outputs results to JSON File
......
......@@ -211,6 +211,41 @@ class Job(Entity): # inherits from the Entity c
return curStepSeq
#===========================================================================
# return the responsible operator for the current step
#===========================================================================
def responsibleForCurrentStep(self):
''' The route is supposed to provide information on the responsible personnel for
the current (or next) station step in the sequence of the route
E.g.
{
"stepNumber": "6",
"sequence": "4",
"requiredParts": ["OC1", "OC2"],
"operator": "OP1",
"stationIdsList": [
"EDM"
],
"processingTime": {
"distributionType": "Fixed",
"operationType": "",
"mea n": "2"
}
},
'''
currentStation=self.currentStation
from Machine import Machine
if issubclass(currentStation.__class__, Machine):
for routeStep in self.route:
stepResponsible=routeStep.get('operator','not available')
stepIDs=routeStep.get('stationIdsList',[])
if currentStation.id in stepIDs:
responsible=stepResponsible
break
else:
responsible=self.remainingRoute[0].get('operator','not available')
return responsible
#===========================================================================
# method that finds a receiver for a candidate entity
#===========================================================================
def findCandidateReceiver(self):
......
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