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
5649093c
Commit
5649093c
authored
Aug 19, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plugin to be able to identify stations that may share batches
parent
a96d270b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
86 additions
and
2 deletions
+86
-2
dream/plugins/Batches/BatchesWIPShort.py
dream/plugins/Batches/BatchesWIPShort.py
+74
-2
dream/plugins/plugin.py
dream/plugins/plugin.py
+12
-0
No files found.
dream/plugins/Batches/BatchesWIPShort.py
View file @
5649093c
...
...
@@ -13,5 +13,77 @@ class BatchesWIPShort(plugin.InputPreparationPlugin):
"""
def
preprocess
(
self
,
data
):
print
1
return
data
\ No newline at end of file
nodes
=
data
[
'graph'
][
'node'
]
WIPData
=
data
[
'input'
].
get
(
self
.
configuration_dict
[
'input_id'
],
{})
from
pprint
import
pprint
# pprint(WIPData)
# get the number of units for a standard batch
standardBatchUnits
=
0
for
node_id
,
node
in
nodes
.
iteritems
():
if
node
[
'_class'
]
==
'Dream.BatchSource'
:
standardBatchUnits
=
int
(
node
[
'batchNumberOfUnits'
])
node
[
'wip'
]
=
[]
# remove the titles
WIPData
.
pop
(
0
)
for
row
in
WIPData
:
# on the first empty row break
if
not
row
[
0
]:
break
# if there is not record for the station continue
if
(
not
row
[
1
])
and
not
(
row
[
2
]):
pass
# continue
stationId
=
row
[
0
]
workingBatchSize
=
nodes
[
stationId
][
'workingBatchSize'
]
# get a list with the stations that the station might share batches with (if any)
sharingStations
=
[]
if
workingBatchSize
!=
standardBatchUnits
:
sharingStations
=
self
.
findSharingStations
(
data
,
stationId
)
print
stationId
,
workingBatchSize
,
sharingStations
return
data
# gets the data and a station id and returns a list with all the stations that the station may share batches
def
findSharingStations
(
self
,
data
,
stationId
):
nodes
=
data
[
'graph'
][
'node'
]
sharingStations
=
[]
current
=
stationId
# find all the predecessors that may share batches
while
1
:
previous
=
self
.
getPredecessors
(
data
,
current
)[
0
]
# when a decomposition is reached break
if
'Decomposition'
in
nodes
[
previous
][
'_class'
]:
break
# when a station is reach add it
if
'Machine'
in
nodes
[
previous
][
'_class'
]
or
'M3'
in
nodes
[
previous
][
'_class'
]:
sharingStations
.
append
(
previous
)
# append also the parallel stations (this implies a symmetry)
parallelStations
=
self
.
getParallelStations
(
data
,
previous
)
sharingStations
.
extend
(
parallelStations
)
current
=
previous
current
=
stationId
# find all the successors that may share batches
while
1
:
next
=
self
.
getSuccessors
(
data
,
current
)[
0
]
# when a reassembly is reached break
if
'Reassembly'
in
nodes
[
next
][
'_class'
]:
break
# when a station is reach add it
if
'Machine'
in
nodes
[
next
][
'_class'
]
or
'M3'
in
nodes
[
next
][
'_class'
]:
sharingStations
.
append
(
next
)
# append also the parallel stations (this implies a symmetry)
parallelStations
=
self
.
getParallelStations
(
data
,
next
)
sharingStations
.
extend
(
parallelStations
)
current
=
next
return
sharingStations
\ No newline at end of file
dream/plugins/plugin.py
View file @
5649093c
...
...
@@ -33,6 +33,18 @@ class Plugin(object):
successors
.
append
(
edge
[
'destination'
])
return
successors
# returns the parallel stations for a station if any
def
getParallelStations
(
self
,
data
,
node_id
):
predecessors
=
self
.
getPredecessors
(
data
,
node_id
)
if
not
predecessors
:
return
[]
previous
=
predecessors
[
0
]
parallelStations
=
self
.
getSuccessors
(
data
,
previous
)
parallelStations
.
remove
(
node_id
)
return
parallelStations
# calculate the confidence interval for a list and a confidence level
def
getConfidenceInterval
(
self
,
value_list
,
confidenceLevel
):
from
dream.KnowledgeExtraction.ConfidenceIntervals
import
ConfidenceIntervals
...
...
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