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
281333da
Commit
281333da
authored
Feb 16, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plugin updated to arrange the classes accordingly
parent
05cac1e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
2 deletions
+34
-2
dream/plugins/AddBatchStations.py
dream/plugins/AddBatchStations.py
+34
-2
No files found.
dream/plugins/AddBatchStations.py
View file @
281333da
...
...
@@ -23,6 +23,36 @@ class AddBatchStations(plugin.InputPreparationPlugin):
for
node_id
,
node
in
nodes
.
iteritems
():
if
node
[
'_class'
]
==
'Dream.BatchSource'
:
standardBatchUnits
=
int
(
node
[
'numberOfUnits'
])
# loop in BatchScrapMachines to change the classes if need be
for
node_id
,
node
in
nodes
.
iteritems
():
if
node
[
'_class'
]
==
'Dream.BatchScrapMachine'
:
# get the first successor. If it is BatchReassembly set the class to M3
successorIdList
=
self
.
getSuccessors
(
data
,
node_id
)
if
successorIdList
:
successorId
=
successorIdList
[
0
]
successorClass
=
nodes
[
successorId
][
'_class'
]
if
successorClass
==
'Dream.BatchReassembly'
:
data
[
'graph'
][
'node'
][
node_id
][
'_class'
]
=
'Dream.M3'
# get the first predecessor. If it is BatchDecomposition set the class to BatchScrapMachineAfterDecompose
predecessorIdList
=
self
.
getPredecessors
(
data
,
node_id
)
if
predecessorIdList
:
predecessorId
=
predecessorIdList
[
0
]
predecessorClass
=
nodes
[
predecessorId
][
'_class'
]
if
predecessorClass
==
'Dream.BatchDecomposition'
:
data
[
'graph'
][
'node'
][
node_id
][
'_class'
]
=
'Dream.BatchScrapMachineAfterDecompose'
# loop in BatchDecompositions to change the classes to BatchDecompositionBlocking
# XXX StartTime to be thought upon
for
node_id
,
node
in
nodes
.
iteritems
():
if
node
[
'_class'
]
==
'Dream.BatchDecomposition'
:
data
[
'graph'
][
'node'
][
node_id
][
'_class'
]
=
'Dream.BatchDecompositionBlocking'
# loop in BatchReassemblies to change the classes to BatchReassemblyBlocking
for
node_id
,
node
in
nodes
.
iteritems
():
if
node
[
'_class'
]
==
'Dream.BatchReassembly'
:
data
[
'graph'
][
'node'
][
node_id
][
'_class'
]
=
'Dream.BatchReassemblyBlocking'
# loop through the nodes to find the machines that do need addition
machinesThatNeedAddition
=
{}
...
...
@@ -88,7 +118,9 @@ class AddBatchStations(plugin.InputPreparationPlugin):
# add an edge from batchReassembly to destination
self
.
addEdge
(
data
,
batchReassemblyId
,
destination
)
dataString
=
json
.
dumps
(
data
[
'graph'
][
'edge'
],
indent
=
5
)
#print dataString
# print dataString
# for node_id, node in nodes.iteritems():
# print node_id, node['_class']
return
data
# returns true if it is needed to add decomposition/reassembly
...
...
@@ -101,7 +133,7 @@ class AddBatchStations(plugin.InputPreparationPlugin):
# loop in the predecessors
currentId
=
machineId
while
1
:
predecessorIdsList
=
self
.
find
Predecessors
(
data
,
currentId
)
predecessorIdsList
=
self
.
get
Predecessors
(
data
,
currentId
)
# get the first. In this model every machine is fed by one point
if
predecessorIdsList
:
predecessorId
=
predecessorIdsList
[
0
]
...
...
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