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
675339d7
Commit
675339d7
authored
Dec 13, 2013
by
Georgios Dagkakis
Committed by
Jérome Perrin
Jan 20, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
main JSON script updated to include new custom objects
parent
3709bb4e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
2 deletions
+56
-2
dream/simulation/LineGenerationJSON.py
dream/simulation/LineGenerationJSON.py
+56
-2
No files found.
dream/simulation/LineGenerationJSON.py
View file @
675339d7
...
...
@@ -82,6 +82,8 @@ from Operator import Operator
from
OperatorPool
import
OperatorPool
from
OperatedPoolBroker
import
Broker
from
OperatedMachine
import
OperatedMachine
from
BatchDecompositionStartTime
import
BatchDecompositionStartTime
from
M3
import
M3
import
ExcelHandler
import
time
...
...
@@ -147,12 +149,12 @@ def createObjects():
G
.
BatchSourceList
=
[]
G
.
BatchReassemblyList
=
[]
G
.
LineClearanceList
=
[]
G
.
BatchScrapMachine
=
[]
G
.
EventGeneratorList
=
[]
G
.
OperatorsList
=
[]
G
.
OperatorPoolsList
=
[]
G
.
BrokersList
=
[]
G
.
OperatedMachineList
=
[]
G
.
BatchScrapMachineList
=
[]
# -----------------------------------------------------------------------
# loop through all the model resources
...
...
@@ -293,7 +295,42 @@ def createObjects():
scrStdev
=
scrStdev
,
scrMin
=
scrMin
,
scrMax
=
scrMax
)
M
.
nextIds
=
getSuccessorList
(
id
)
# update the nextIDs list of the machine
G
.
MachineList
.
append
(
M
)
# add machine to global MachineList
G
.
BatchScrapMachine
.
append
(
M
)
G
.
BatchScrapMachineList
.
append
(
M
)
G
.
ObjList
.
append
(
M
)
# add machine to ObjList
elif
objClass
==
'Dream.M3'
:
id
=
element
.
get
(
'id'
,
'not found'
)
name
=
element
.
get
(
'name'
,
'not found'
)
processingTime
=
element
.
get
(
'processingTime'
,
'not found'
)
distributionType
=
processingTime
.
get
(
'distributionType'
,
'not found'
)
mean
=
float
(
processingTime
.
get
(
'mean'
,
'0'
))
stdev
=
float
(
processingTime
.
get
(
'stdev'
,
'0'
))
min
=
float
(
processingTime
.
get
(
'min'
,
'0'
))
max
=
float
(
processingTime
.
get
(
'max'
,
'0'
))
scrapQuantity
=
element
.
get
(
'scrapQuantity'
,
'not found'
)
scrapDistributionType
=
scrapQuantity
.
get
(
'distributionType'
,
'not found'
)
scrMean
=
int
(
scrapQuantity
.
get
(
'mean'
,
'0'
))
scrStdev
=
float
(
scrapQuantity
.
get
(
'stdev'
,
'0'
))
scrMin
=
int
(
scrapQuantity
.
get
(
'min'
,
'0'
))
scrMax
=
int
(
scrapQuantity
.
get
(
'max'
,
'0'
))
failures
=
element
.
get
(
'failures'
,
'not found'
)
failureDistribution
=
failures
.
get
(
'failureDistribution'
,
'not found'
)
MTTF
=
float
(
failures
.
get
(
'MTTF'
,
'0'
))
MTTR
=
float
(
failures
.
get
(
'MTTR'
,
'0'
))
availability
=
float
(
failures
.
get
(
'availability'
,
'0'
))
r
=
'None'
for
repairman
in
G
.
RepairmanList
:
# check which repairman in the G.RepairmanList
if
(
id
in
repairman
.
coreObjectIds
):
# (if any) is assigned to repair
r
=
repairman
# the machine with ID equal to id
M
=
M3
(
id
,
name
,
1
,
distribution
=
distributionType
,
failureDistribution
=
failureDistribution
,
MTTF
=
MTTF
,
MTTR
=
MTTR
,
availability
=
availability
,
repairman
=
r
,
mean
=
mean
,
stdev
=
stdev
,
min
=
min
,
max
=
max
,
scrMean
=
scrMean
,
scrStdev
=
scrStdev
,
scrMin
=
scrMin
,
scrMax
=
scrMax
)
M
.
nextIds
=
getSuccessorList
(
id
)
# update the nextIDs list of the machine
G
.
MachineList
.
append
(
M
)
# add machine to global MachineList
G
.
BatchScrapMachineList
.
append
(
M
)
G
.
ObjList
.
append
(
M
)
# add machine to ObjList
...
...
@@ -430,6 +467,23 @@ def createObjects():
BD
.
nextIds
=
getSuccessorList
(
id
)
G
.
BatchDecompositionList
.
append
(
BD
)
G
.
ObjList
.
append
(
BD
)
elif
objClass
==
'Dream.BatchDecompositionStartTime'
:
id
=
element
.
get
(
'id'
,
'not found'
)
name
=
element
.
get
(
'name'
,
'not found'
)
processingTime
=
element
.
get
(
'processingTime'
,
'not found'
)
distributionType
=
processingTime
.
get
(
'distributionType'
,
'not found'
)
mean
=
float
(
processingTime
.
get
(
'mean'
,
'0'
))
stdev
=
float
(
processingTime
.
get
(
'stdev'
,
'0'
))
min
=
float
(
processingTime
.
get
(
'min'
,
'0'
))
max
=
float
(
processingTime
.
get
(
'max'
,
'0'
))
numberOfSubBatches
=
int
(
element
.
get
(
'numberOfSubBatches'
,
'0'
))
BD
=
BatchDecompositionStartTime
(
id
,
name
,
distribution
=
distributionType
,
numberOfSubBatches
=
numberOfSubBatches
,
mean
=
mean
,
stdev
=
stdev
,
min
=
min
,
max
=
max
)
BD
.
nextIds
=
getSuccessorList
(
id
)
G
.
BatchDecompositionList
.
append
(
BD
)
G
.
ObjList
.
append
(
BD
)
elif
objClass
==
'Dream.BatchReassembly'
:
id
=
element
.
get
(
'id'
,
'not found'
)
...
...
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