Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
ca09828e
Commit
ca09828e
authored
Feb 17, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'OperatorExamples'
parents
70cfe089
1f431ab7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
17 deletions
+20
-17
dream/simulation/Machine.py
dream/simulation/Machine.py
+20
-17
No files found.
dream/simulation/Machine.py
View file @
ca09828e
...
...
@@ -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
self
.
dedicatedOperator
=
self
.
checkForDedicatedOperators
()
if
len
(
G
.
OperatorPoolsList
)
>
0
:
for
operatorPool
in
G
.
OperatorPoolsList
:
# find the operatorPool assigned to the machine
if
(
self
.
id
in
operatorPool
.
coreObjectIds
):
# and add it to the machine's operatorPool
machineOperatorPoolList
=
operatorPool
# there must only one operator pool assigned to the machine,
# otherwise only one of them will be taken into account
else
:
machineOperatorPoolList
=
[]
# if there is no operatorPool assigned to the machine
else
:
# then machineOperatorPoolList/operatorPool is a list
machineOperatorPoolList
=
[]
# if there are no operatorsPool created then the
# then machineOperatorPoolList/operatorPool is a list
if
(
type
(
machineOperatorPoolList
)
is
list
):
# if the machineOperatorPoolList is a list
# find the operators assigned to it and add them to the list
for
operator
in
G
.
OperatorsList
:
# check which operator in the G.OperatorsList
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
if
operatorPool
and
not
(
operatorPool
==
'None'
):
self
.
operatorPool
=
operatorPool
else
:
if
len
(
G
.
OperatorPoolsList
)
>
0
:
for
operatorPool
in
G
.
OperatorPoolsList
:
# find the operatorPool assigned to the machine
if
(
self
.
id
in
operatorPool
.
coreObjectIds
):
# and add it to the machine's operatorPool
machineOperatorPoolList
=
operatorPool
# there must only one operator pool assigned to the machine,
# otherwise only one of them will be taken into account
else
:
machineOperatorPoolList
=
[]
# if there is no operatorPool assigned to the machine
else
:
# then machineOperatorPoolList/operatorPool is a list
machineOperatorPoolList
=
[]
# if there are no operatorsPool created then the
# then machineOperatorPoolList/operatorPool is a list
if
(
type
(
machineOperatorPoolList
)
is
list
):
# if the machineOperatorPoolList is a list
# find the operators assigned to it and add them to the list
for
operator
in
G
.
OperatorsList
:
# check which operator in the G.OperatorsList
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
()
# create an operatorPool if needed
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment