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
08817d68
Commit
08817d68
authored
Dec 06, 2013
by
Ioannis Papagiannopoulos
Committed by
Sebastien Robin
Dec 11, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
creation of OperatedMachine-class objects corrected in LineGenerationJSON.py
parent
62646a29
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
12 deletions
+27
-12
dream/simulation/LineGenerationJSON.py
dream/simulation/LineGenerationJSON.py
+27
-12
No files found.
dream/simulation/LineGenerationJSON.py
View file @
08817d68
...
...
@@ -489,20 +489,35 @@ def createObjects():
loadMin
=
float
(
loadTime
.
get
(
'loadMin'
,
'0'
))
loadMax
=
float
(
loadTime
.
get
(
'loadMax'
,
'0'
))
# machineOpertorPoolList=[]
try
:
for
operatorPool
in
G
.
operatorPoolsList
:
# find the operatorPool assigned to the machine
if
len
(
G
.
OperatorPoolsList
)
>
0
:
for
operatorPool
in
G
.
OperatorPoolsList
:
# find the operatorPool assigned to the machine
if
(
id
in
operatorPool
.
coreObjectIds
):
# and add it to the machine's operatorPool
machineOperatorPoolList
=
operatorPool
# there must only one operator pool assigned to the machine,
machineOperatorPoolList
=
operatorPool
# there must only one operator pool assigned to the machine,
# otherwise only one of them will be taken into account
except
:
# pass
# if len(machineOperatorPoolList)==None: # if there is no operatorPool assigned to the machine
machineOperatorPoolList
=
[]
# find the operators assigned to it and add them to a list
for
operator
in
G
.
OperatorsList
:
# check which operator in the G.OperatorsList
if
(
id
in
operator
.
coreObjectIds
):
# (if any) is assigned to operate
machineOperatorPoolList
.
append
(
operator
)
# the machine with ID equal to id
# if there is no operator assigned then the list will be empty
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
(
id
in
operator
.
coreObjectIds
):
# (if any) is assigned to operate
machineOperatorPoolList
.
append
(
operator
)
# the machine with ID equal to id
# if there is no operator assigned then the list will be empty
# try:
# for operatorPool in G.operatorPoolsList: # find the operatorPool assigned to the machine
# if(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
# except:
# # pass
# # if len(machineOperatorPoolList)==None: # if there is no operatorPool assigned to the machine
# machineOperatorPoolList=[] # find the operators assigned to it and add them to a list
# for operator in G.OperatorsList: # check which operator in the G.OperatorsList
# if(id in operator.coreObjectIds): # (if any) is assigned to operate
# machineOperatorPoolList.append(operator) # the machine with ID equal to id
# # if there is no operator assigned then the list will be empty
OM
=
OperatedMachine
(
id
,
name
,
1
,
distribution
=
distributionType
,
failureDistribution
=
failureDistribution
,
MTTF
=
MTTF
,
MTTR
=
MTTR
,
availability
=
availability
,
#repairman=r,
...
...
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