skills-set first approach

parent 646dc69a
......@@ -37,7 +37,7 @@ from ObjectResource import ObjectResource
class Operator(ObjectResource):
family='Operator'
def __init__(self, id, name, capacity=1, schedulingRule='FIFO', skills=[], available=True,ouputSchedule=False,**kw):
def __init__(self, id, name, capacity=1, schedulingRule='FIFO', skillDict={}, skills=[], available=True,ouputSchedule=False,**kw):
ObjectResource.__init__(self,id=id, name=name)
self.objName=name
self.capacity=int(capacity) # repairman is an instance of resource
......@@ -79,6 +79,8 @@ class Operator(ObjectResource):
self.alias=self.id
# list attribute that describes the skills of the operator in terms of stations he can operate
self.skillsList=skills
# skils dict (defining also if the skill is regarding different operations on the same technology)
self.skillDict = skillDict
# flag to show if the resource is available at the start of simulation
self.available=available
from Globals import G
......
......@@ -311,8 +311,14 @@ class Router(ObjectInterruption):
candidateOperators=station.operatorPool.availableOperators()
if candidateOperators: # if there was an operator found append the Machine on his candidateStations
for candidateOperator in candidateOperators:
if not station in candidateOperator.candidateStations:
candidateOperator.candidateStations.append(station)
# XXX not generic enough - find an other way to initiate skilledRouter and incorporate also setup and load
if candidateOperator.skillDict:
if station.id in candidateOperator.skillDict["process"]:
if not station in candidateOperator.candidateStations:
candidateOperator.candidateStations.append(station)
else:
if not station in candidateOperator.candidateStations:
candidateOperator.candidateStations.append(station)
if not candidateOperator in self.candidateOperators:
self.candidateOperators.append(candidateOperator)
# if there are critical pending entities then populate the candidateOperators list with preemptiveOperators
......
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