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
f8806fff
Commit
f8806fff
authored
Jul 29, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LPmethod does not need a main in the ManPy framework
parent
af9a1d3d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
37 deletions
+2
-37
dream/simulation/opAss_LPmethod.py
dream/simulation/opAss_LPmethod.py
+2
-37
No files found.
dream/simulation/opAss_LPmethod.py
View file @
f8806fff
...
...
@@ -6,7 +6,6 @@ Created on 2 Jul 2014
from
pulp
import
*
def
opAss_LP
(
stationList
,
PBlist
,
PBskills
):
'''
classdocs
...
...
@@ -28,7 +27,7 @@ def opAss_LP(stationList, PBlist, PBskills):
for
machine
in
machines
:
prob
+=
lpSum
([
PB_ass
[(
oper
,
machine
)]
for
oper
in
PBlist
])
<=
1
# constraint 2: # machines assigned to an o
ep
rator <= 1
# constraint 2: # machines assigned to an o
pe
rator <= 1
for
operator
in
PBlist
:
prob
+=
lpSum
([
PB_ass
[(
operator
,
machine
)]
for
machine
in
machines
])
<=
1
...
...
@@ -48,46 +47,12 @@ def opAss_LP(stationList, PBlist, PBskills):
prob
.
solve
()
solution
=
{}
for
mach
in
machines
:
for
oper
in
PBlist
:
for
oper
in
PBlist
:
if
PB_ass
[(
oper
,
mach
)].
varValue
>
0.00001
:
# print 'PB', oper, 'assigned to machine', mach
solution
[
str
(
oper
)]
=
str
(
mach
)
return
solution
def
main
():
# dict with stations to be operated during a shift (only active stations...ID can be the same for 2 machines as it identifies the type of process
# WIP can be derived from the buffer upstream the station...when 2 machines operate at a step the WIP will be divided between the two machines
stations
=
{}
stations
[
'M1'
]
=
{
'stationID'
:
1
,
'WIP'
:
1
}
stations
[
'M2'
]
=
{
'stationID'
:
2
,
'WIP'
:
1
}
# stations['M3'] = {'stationID':3, 'WIP':1}
# stations['M4'] = {'stationID':4, 'WIP':1}
# stations['M5'] = {'stationID':5, 'WIP':1}
# stations['M6'] = {'stationID':6, 'WIP':1}
# dict with stations' IDs on which an operator can work
PBskills
=
{}
PBskills
[
'PB1'
]
=
[
1
,
2
]
#, 3]
PBskills
[
'PB2'
]
=
[
1
,
2
]
#, 3]
# PBskills['PB3'] = [4, 5]
# PBskills['PB4'] = [2, 4]
# PBskills['PB5'] = [1, 2]
# PBskills['PB6'] = [2, 3, 4]
# PBskills['PB7'] = [5, 6]
# PBskills['PB8'] = [5]
# PBskills['PB9'] = [6]
# list of available PB's
# PBlist = ['PB2', 'PB4', 'PB5', 'PB7']
PBlist
=
[
'PB1'
,
'PB2'
]
opAss_LP
(
stations
,
PBlist
,
PBskills
)
if
__name__
==
'__main__'
:
main
()
\ 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