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
59be9a14
Commit
59be9a14
authored
Feb 10, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
further corrections in plugins
parent
5246bfae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
19 deletions
+11
-19
dream/plugins/CapacityStationWIPSpreadsheet.py
dream/plugins/CapacityStationWIPSpreadsheet.py
+7
-17
dream/plugins/CreateCapacityStations.py
dream/plugins/CreateCapacityStations.py
+4
-2
No files found.
dream/plugins/CapacityStationWIPSpreadsheet.py
View file @
59be9a14
...
...
@@ -23,33 +23,23 @@ class CapacityStationWIPSpreadsheet(plugin.InputPreparationPlugin):
if
node_data
[
'_class'
]
==
'dream.simulation.applications.CapacityStations.CapacityStationBuffer.CapacityStationBuffer'
:
node_data
[
'wip'
]
=
[]
# get the number of projects
numberOfProjects
=
0
for
col
in
range
(
1
,
len
(
wipData
[
0
])):
if
wipData
[
0
][
col
]:
numberOfProjects
+=
1
else
:
break
numberOfProjects
=
len
([
pr
for
pr
in
wipData
[
0
]
if
(
pr
and
not
pr
==
'Operation'
)])
# get the number of operations
numberOfOperations
=
0
for
row
in
range
(
1
,
len
(
wipData
)):
if
wipData
[
row
][
0
]:
numberOfOperations
+=
1
else
:
break
numberOfOperations
=
len
([
op
for
op
in
wipData
if
(
op
[
0
]
and
not
op
[
0
]
==
'Operation'
)])
# loop through all the columns>0
for
col
in
range
(
1
,
numberOfProjects
+
1
):
projectId
=
wipData
[
0
][
col
]
# loop through all the rows>0
for
row
in
range
(
1
,
numberOf
Project
s
+
1
):
for
row
in
range
(
1
,
numberOf
Operation
s
+
1
):
stationId
=
wipData
[
row
][
0
]
assert
stationId
in
node
.
keys
(),
'wip spreadsheet has station id that does not exist in production line'
requiredCapacity
=
wipData
[
row
][
col
]
requiredCapacity
=
float
(
wipData
[
row
][
col
])
# if the cell has a requiredCapacity>0 create the entity
if
requiredCapacity
:
b
uffer
=
self
.
getBuffer
(
data
,
stationId
)
data
[
'graph'
][
'node'
][
b
uffer
][
'wip'
].
append
({
capacityB
uffer
=
self
.
getBuffer
(
data
,
stationId
)
data
[
'graph'
][
'node'
][
capacityB
uffer
][
'wip'
].
append
({
"_class"
:
"dream.simulation.applications.CapacityStations.CapacityEntity.CapacityEntity"
,
"requiredCapacity"
:
float
(
requiredCapacity
)
,
"requiredCapacity"
:
requiredCapacity
,
"capacityProjectId"
:
projectId
,
"name"
:
projectId
+
'_'
+
stationId
+
'_'
+
str
(
requiredCapacity
)
})
...
...
dream/plugins/CreateCapacityStations.py
View file @
59be9a14
...
...
@@ -17,7 +17,10 @@ class CreateCapacityStations(plugin.InputPreparationPlugin):
for
(
stationId
,
node
)
in
nodes
.
iteritems
():
_class
=
node
[
'_class'
]
if
_class
==
'dream.simulation.applications.CapacityStations.CapacityStation.CapacityStation'
:
nextCapacityStationBufferId
=
self
.
getSuccessor
(
data
,
stationId
)
nextCapacityStationBufferId
=
self
.
getSuccessor
(
data
,
stationId
)
# the nextCapacityStationBufferId should point to the buffer
if
nextCapacityStationBufferId
:
nextCapacityStationBufferId
+=
'_B'
stationName
=
node
[
'name'
]
# create the CapacityStationBuffer
bufferName
=
stationName
+
'_Buffer'
...
...
@@ -77,4 +80,3 @@ class CreateCapacityStations(plugin.InputPreparationPlugin):
if
edgeToErase
:
data
[
'graph'
][
'edge'
].
pop
(
edgeToErase
,
None
)
return
successorId
\ 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