Station from skillDict of operators are added to their coreObjectIds list so...

Station from skillDict of operators are added to their coreObjectIds list so that operator pools are created
parent 6e6af093
......@@ -160,7 +160,13 @@ def createObjectResourcesAndCoreObjects():
inputDict=dict(element)
# create the CoreObject
objectResource=objectType(**inputDict)
objectResource.coreObjectIds=getSuccessorList(element['id'])
# if there already coreObjectsIds defined then append the successors to them
if objectResource.coreObjectIds:
for element in getSuccessorList(element['id']):
if not element in objectResource.coreObjectIds:
objectResource.coreObjectIds.append(element)
else:
objectResource.coreObjectIds=getSuccessorList(element['id'])
'''
loop through all the model resources
......
......@@ -81,6 +81,13 @@ class Operator(ObjectResource):
self.skillsList=skills
# skils dict (defining also if the skill is regarding different operations on the same technology)
self.skillDict = skillDict
# if there is a skillDict add the stations defined to the operators coreObjectIds
if skillDict:
for operation_stations in skillDict.values():
for station in operation_stations:
if not station in self.coreObjectIds:
# append the station ID to the correObjectIds
self.coreObjectIds.append(station)
# flag to show if the resource is available at the start of simulation
self.available=available
from Globals import G
......
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