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
27e90ab1
Commit
27e90ab1
authored
Aug 20, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
two auxiliary methods added
parent
daf942e3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
5 deletions
+34
-5
dream/plugins/Batches/BatchesWIPShort.py
dream/plugins/Batches/BatchesWIPShort.py
+34
-5
No files found.
dream/plugins/Batches/BatchesWIPShort.py
View file @
27e90ab1
...
@@ -55,17 +55,18 @@ class BatchesWIPShort(plugin.InputPreparationPlugin):
...
@@ -55,17 +55,18 @@ class BatchesWIPShort(plugin.InputPreparationPlugin):
# set the WIP for every group
# set the WIP for every group
for
group
in
groups
:
for
group
in
groups
:
# if
we have stations that may share sub-batches
# if
the station does not work in full batch
groupWorkingBatchSize
=
nodes
[
group
[
0
]][
'workingBatchSize'
]
groupWorkingBatchSize
=
nodes
[
group
[
0
]][
'workingBatchSize'
]
if
groupWorkingBatchSize
<
standardBatchUnits
:
currentBatchId
=
'Batch_'
+
str
(
batchCounter
)
+
'_WIP'
currentBatchId
=
'Batch_'
+
str
(
batchCounter
)
+
'_WIP'
subBatchCounter
=
0
subBatchCounter
=
0
unitsToCompleteBatch
=
standardBatchUnits
unitsToCompleteBatch
=
standardBatchUnits
group
.
sort
(
key
=
lambda
x
:
self
.
getDistanceFromSource
(
data
,
x
))
group
.
sort
(
key
=
lambda
x
:
self
.
getDistanceFromSource
(
data
,
x
))
if
groupWorkingBatchSize
<
standardBatchUnits
:
for
stationId
in
group
:
for
stationId
in
group
:
workingBatchSize
=
nodes
[
stationId
][
'workingBatchSize'
]
workingBatchSize
=
nodes
[
stationId
][
'workingBatchSize'
]
stationWIPData
=
[
element
for
element
in
WIPData
if
element
[
0
]
==
stationId
][
0
]
stationWIPData
=
[
element
for
element
in
WIPData
if
element
[
0
]
==
stationId
][
0
]
print
stationWIPData
print
stationWIPData
print
stationId
,
self
.
checkIfStationIsAfterDecomposition
(
data
,
stationId
),
self
.
getBuffer
(
data
,
stationId
)
awaiting
=
stationWIPData
[
1
]
awaiting
=
stationWIPData
[
1
]
complete
=
stationWIPData
[
2
]
complete
=
stationWIPData
[
2
]
if
not
awaiting
:
if
not
awaiting
:
...
@@ -205,5 +206,33 @@ class BatchesWIPShort(plugin.InputPreparationPlugin):
...
@@ -205,5 +206,33 @@ class BatchesWIPShort(plugin.InputPreparationPlugin):
current
=
previous
current
=
previous
return
distance
return
distance
# returns the buffer for a station id.
def
getBuffer
(
self
,
data
,
stationId
):
nodes
=
data
[
'graph'
][
'node'
]
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
'Queue'
in
nodes
[
previous
][
'_class'
]
or
'Clearance'
in
nodes
[
previous
][
'_class'
]:
return
previous
if
'Source'
in
nodes
[
previous
][
'_class'
]
or
'Clearance'
in
nodes
[
previous
][
'_class'
]:
return
None
current
=
previous
# returns true if the buffer is closer to a decompositions than a buffer
def
checkIfStationIsAfterDecomposition
(
self
,
data
,
stationId
):
nodes
=
data
[
'graph'
][
'node'
]
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
'Queue'
in
nodes
[
previous
][
'_class'
]
or
'Clearance'
in
nodes
[
previous
][
'_class'
]:
return
False
if
'Decomposition'
in
nodes
[
previous
][
'_class'
]:
return
True
current
=
previous
\ No newline at end of file
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