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
025f81ac
Commit
025f81ac
authored
Jan 30, 2014
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ACO: do not output twice solutions that leads to same jobs schedule
parent
73b30d50
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
dream/simulation/GUI/ACO.py
dream/simulation/GUI/ACO.py
+10
-1
No files found.
dream/simulation/GUI/ACO.py
View file @
025f81ac
...
...
@@ -101,9 +101,18 @@ class Simulation(DefaultSimulation):
ant
[
'result'
]
=
DefaultSimulation
.
runOneScenario
(
self
,
ant_data
)
ant
[
'score'
]
=
self
.
_calculateAntScore
(
ant
)
# remove ants that outputs the same schedules
ants_without_duplicates
=
dict
()
for
ant
in
ants
:
ant_result
=
copy
(
ant
[
'result'
])
ant_result
[
'general'
].
pop
(
'totalExecutionTime'
,
None
)
ant_result
=
json
.
dumps
(
ant_result
,
sort_keys
=
True
)
ants_without_duplicates
[
ant_result
]
=
ant
# The ants in this generation are ranked based on their scores and the
# best (max_results) are selected
ants
=
sorted
(
ants
,
key
=
operator
.
itemgetter
(
'score'
))[:
max_results
]
ants
=
sorted
(
ants_without_duplicates
.
values
(),
key
=
operator
.
itemgetter
(
'score'
))[:
max_results
]
for
l
in
ants
:
# update the options list to ensure that good performing queue-rule
...
...
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