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
ee6b48bb
Commit
ee6b48bb
authored
Jan 30, 2014
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make "number of solutions" a user defined parameter
parent
25e1efb4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
dream/simulation/GUI/ACO.py
dream/simulation/GUI/ACO.py
+8
-3
No files found.
dream/simulation/GUI/ACO.py
View file @
ee6b48bb
...
...
@@ -10,8 +10,6 @@ from dream.simulation.Globals import getClassFromName
class
Simulation
(
DefaultSimulation
):
max_results
=
4
def
getConfigurationDict
(
self
):
conf
=
DefaultSimulation
.
getConfigurationDict
(
self
)
conf
[
"Dream-Configuration"
][
"property_list"
].
append
(
...
...
@@ -24,6 +22,11 @@ class Simulation(DefaultSimulation):
"type"
:
"integer"
,
"_class"
:
"Dream.Property"
,
"_default"
:
"20"
}
)
conf
[
"Dream-Configuration"
][
"property_list"
].
append
(
{
"id"
:
"numberOfSolutions"
,
"type"
:
"integer"
,
"_class"
:
"Dream.Property"
,
"_default"
:
"4"
}
)
return
conf
def
_preprocess
(
self
,
data
):
...
...
@@ -62,6 +65,8 @@ class Simulation(DefaultSimulation):
if
issubclass
(
node_class
,
Queue
):
collated
[
node_id
]
=
list
(
node_class
.
getSupportedSchedulingRules
())
max_results
=
int
(
data
[
'general'
][
'numberOfSolutions'
])
ants
=
[]
#list of ants for keeping track of their performance
# Number of times new ants are to be created, i.e. number of generations (a
...
...
@@ -100,7 +105,7 @@ class Simulation(DefaultSimulation):
# 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'
))[:
self
.
max_results
]
ants
=
sorted
(
ants
,
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