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
a4fd40f7
Commit
a4fd40f7
authored
Mar 01, 2014
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use isinstance to check type
parent
d0bcdff9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
12 deletions
+3
-12
dream/simulation/GUI/PartJobShop.py
dream/simulation/GUI/PartJobShop.py
+0
-10
dream/simulation/Globals.py
dream/simulation/Globals.py
+3
-2
No files found.
dream/simulation/GUI/PartJobShop.py
View file @
a4fd40f7
...
...
@@ -88,7 +88,6 @@ class Simulation(ACO.Simulation):
for
machine_name
in
self
.
data
[
"nodes"
].
keys
():
if
machine_name
.
startswith
(
step_name
):
machine_name_set
.
add
(
machine_name
)
print
"getMachineNameSet, %r : %r"
%
(
step_name
,
machine_name_set
)
return
machine_name_set
def
getNotMachineNodePredecessorList
(
self
,
step_name
):
...
...
@@ -99,7 +98,6 @@ class Simulation(ACO.Simulation):
predecessor_list
=
[]
machine_name_set
=
self
.
getMachineNameSet
(
step_name
)
for
edge
in
self
.
data
[
"edges"
].
values
():
print
"getNotMachineNodePredecessorList, edge[1]: %r"
%
edge
[
1
]
if
edge
[
1
]
in
machine_name_set
:
predecessor_step
=
edge
[
0
]
if
predecessor_step
in
predecessor_list
:
...
...
@@ -108,7 +106,6 @@ class Simulation(ACO.Simulation):
predecessor_list
=
[
predecessor_step
]
+
predecessor_list
predecessor_list
=
[
x
for
x
in
self
.
getNotMachineNodePredecessorList
(
predecessor_step
)
\
if
x
not
in
predecessor_list
]
+
predecessor_list
print
"getNotMachineNodePredecessorList, %r : %r"
%
(
step_name
,
predecessor_list
)
return
predecessor_list
def
getRouteList
(
self
,
sequence_list
,
processing_time_list
,
prerequisite_list
):
...
...
@@ -153,21 +150,14 @@ class Simulation(ACO.Simulation):
now
=
datetime
.
strptime
(
data
[
'general'
][
'currentDate'
],
'%Y/%m/%d'
)
if
'wip_part_spreadsheet'
in
data
:
# Data is presented as follow, with first line the order, then only parts of this order
# Order ID | Due Date | Priority | Project Manager | Parts | Part Type | Sequence | Processing Time | Electrodes needed
# Order 1 | 2013/02/15 | 1 | PM1 | P1 | type1 | Mach1-Mach2 | 3-5 |
# | | | | P2 | type2 | Mach2-Mach3 | 4-7 |
wip_list
=
[]
print
"wip part data : %r"
%
(
data
[
'wip_part_spreadsheet'
],)
i
=
0
wip_part_spreadsheet_length
=
len
(
data
[
'wip_part_spreadsheet'
])
while
i
<
wip_part_spreadsheet_length
:
value_list
=
data
[
'wip_part_spreadsheet'
][
i
]
print
"first value_list: %r"
%
(
value_list
,)
if
value_list
[
0
]
==
'Order ID'
or
not
value_list
[
4
]:
i
+=
1
continue
print
"still there after first continue"
order_dict
=
{}
wip_list
.
append
(
order_dict
)
order_id
,
due_date
,
priority
,
project_manager
,
part
,
part_type
,
\
...
...
dream/simulation/Globals.py
View file @
a4fd40f7
...
...
@@ -184,11 +184,12 @@ def setWIP(entityList):
entity
.
hot
=
True
# add the entity to the pendingEntities list
G
.
pendingEntities
.
append
(
entity
)
from
Exit
import
Exit
def
countIntervalThroughput
(
argumentDict
=
{}):
currentExited
=
0
for
obj
in
G
.
ObjList
:
if
obj
.
type
is
'Exit'
:
if
isinstance
(
obj
,
Exit
)
:
totalExited
=
obj
.
totalNumberOfUnitsExited
previouslyExited
=
sum
(
obj
.
intervalThroughPutList
)
currentExited
+=
totalExited
-
previouslyExited
...
...
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