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
a986d829
Commit
a986d829
authored
Sep 09, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
do not score positively ants where all orders did not finish
parent
8fd30c47
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
dream/plugins/JobShop/JobShopACO.py
dream/plugins/JobShop/JobShopACO.py
+17
-0
No files found.
dream/plugins/JobShop/JobShopACO.py
View file @
a986d829
...
...
@@ -14,8 +14,14 @@ class JobShopACO(ACO):
totalDelay
=
0
#set the total delay to 0
result
,
=
ant
[
'result'
][
'result_list'
]
#read the result as JSON
#loop through the elements
throughput
=
0
for
element
in
result
[
'elementList'
]:
# find the throughput of the solution
element_family
=
element
.
get
(
'family'
,
None
)
if
element_family
==
'Exit'
:
results
=
element
[
'results'
]
throughput
=
results
.
get
(
'throughput'
,
"0"
)[
0
]
#id the class is Job
if
element_family
==
'Job'
:
results
=
element
[
'results'
]
...
...
@@ -23,6 +29,17 @@ class JobShopACO(ACO):
# A negative delay would mean we are ahead of schedule. This
# should not be considered better than being on time.
totalDelay
+=
max
(
delay
,
0
)
production_orders_spreadsheet
=
ant
[
'input'
][
'input'
].
get
(
'production_orders_spreadsheet'
,[])
# find the number of orders
numberOfOrders
=
0
for
row
in
production_orders_spreadsheet
:
if
row
[
0
]
and
(
not
row
[
0
]
==
"Order Id"
):
numberOfOrders
+=
1
# if in this solution not all orders finished give the total delay as infinite so that it want be considered positive
if
not
throughput
==
numberOfOrders
:
totalDelay
=
float
(
'inf'
)
return
totalDelay
# creates the collated scenarios, i.e. the list
...
...
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