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
4d53e46b
Commit
4d53e46b
authored
Jun 04, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
method to implement the calculation of sscenario score developed
parent
5febc166
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
dream/plugins/CapacityStations/CapacityStationsEnumeration.py
...m/plugins/CapacityStations/CapacityStationsEnumeration.py
+18
-1
No files found.
dream/plugins/CapacityStations/CapacityStationsEnumeration.py
View file @
4d53e46b
...
...
@@ -17,7 +17,24 @@ from multiprocessing import Pool
# enumeration in order to search for the optimal threshold
class
CapacityStationsEnumeration
(
Enumeration
):
def
calculateScenarioScore
(
self
,
scenario
):
return
1
"""Calculate the score of this scenario.
"""
totalDelay
=
0
#set the total delay to 0
result
,
=
scenario
[
'result'
][
'result_list'
]
#read the result as JSON
#loop through the elements
for
element
in
result
[
'elementList'
]:
#id the class is Job
if
element
.
get
(
'_class'
,
None
)
==
"Dream.CapacityProject"
:
id
=
element
[
'id'
]
exitDay
=
element
[
'results'
][
'schedule'
][
-
1
][
'exitTime'
]
for
project
in
scenario
[
'input'
][
'input'
][
'BOM'
][
'productionOrders'
]:
if
project
[
'id'
]
==
id
:
dueDate
=
project
[
'dueDate'
]
delay
=
exitDay
-
dueDate
# A negative delay would mean we are ahead of schedule. This
# should not be considered better than being on time.
totalDelay
+=
max
(
delay
,
0
)
return
totalDelay
# creates the collated scenarios, i.e. the list
# of options collated into a dictionary for ease of referencing in ManPy
...
...
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