Commit ca09828e authored by Georgios Dagkakis's avatar Georgios Dagkakis

Merge branch 'OperatorExamples'

parents 70cfe089 1f431ab7
...@@ -74,23 +74,26 @@ class Machine(CoreObject): ...@@ -74,23 +74,26 @@ class Machine(CoreObject):
# check whether the operators are provided with a skills set # check whether the operators are provided with a skills set
# check whether the operators are provided with a skills set # check whether the operators are provided with a skills set
self.dedicatedOperator=self.checkForDedicatedOperators() self.dedicatedOperator=self.checkForDedicatedOperators()
if len(G.OperatorPoolsList)>0: if operatorPool and not (operatorPool=='None'):
for operatorPool in G.OperatorPoolsList: # find the operatorPool assigned to the machine self.operatorPool=operatorPool
if(self.id in operatorPool.coreObjectIds): # and add it to the machine's operatorPool else:
machineOperatorPoolList=operatorPool # there must only one operator pool assigned to the machine, if len(G.OperatorPoolsList)>0:
# otherwise only one of them will be taken into account for operatorPool in G.OperatorPoolsList: # find the operatorPool assigned to the machine
else: if(self.id in operatorPool.coreObjectIds): # and add it to the machine's operatorPool
machineOperatorPoolList=[] # if there is no operatorPool assigned to the machine machineOperatorPoolList=operatorPool # there must only one operator pool assigned to the machine,
else: # then machineOperatorPoolList/operatorPool is a list # otherwise only one of them will be taken into account
machineOperatorPoolList=[] # if there are no operatorsPool created then the else:
# then machineOperatorPoolList/operatorPool is a list machineOperatorPoolList=[] # if there is no operatorPool assigned to the machine
if (type(machineOperatorPoolList) is list): # if the machineOperatorPoolList is a list else: # then machineOperatorPoolList/operatorPool is a list
# find the operators assigned to it and add them to the list machineOperatorPoolList=[] # if there are no operatorsPool created then the
for operator in G.OperatorsList: # check which operator in the G.OperatorsList # then machineOperatorPoolList/operatorPool is a list
if(self.id in operator.coreObjectIds): # (if any) is assigned to operate if (type(machineOperatorPoolList) is list): # if the machineOperatorPoolList is a list
machineOperatorPoolList.append(operator) # the machine with ID equal to id # find the operators assigned to it and add them to the list
for operator in G.OperatorsList: # check which operator in the G.OperatorsList
self.operatorPool=machineOperatorPoolList if(self.id in operator.coreObjectIds): # (if any) is assigned to operate
machineOperatorPoolList.append(operator) # the machine with ID equal to id
self.operatorPool=machineOperatorPoolList
self.dedicatedOperator=self.checkForDedicatedOperators() self.dedicatedOperator=self.checkForDedicatedOperators()
# create an operatorPool if needed # create an operatorPool if needed
......
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