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
b96b3078
Commit
b96b3078
authored
Apr 02, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
collated scenarios to be created in separated method
parent
c36c572d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
dream/plugins/ACO.py
dream/plugins/ACO.py
+12
-8
No files found.
dream/plugins/ACO.py
View file @
b96b3078
...
@@ -30,6 +30,16 @@ class ACO(plugin.ExecutionPlugin):
...
@@ -30,6 +30,16 @@ class ACO(plugin.ExecutionPlugin):
totalDelay
+=
max
(
delay
,
0
)
totalDelay
+=
max
(
delay
,
0
)
return
totalDelay
return
totalDelay
def
createCollatedScenarios
(
self
,
data
):
# the list of options collated into a dictionary for ease of referencing in
# ManPy
collated
=
dict
()
for
node_id
,
node
in
data
[
'graph'
][
'node'
].
items
():
node_class
=
getClassFromName
(
node
[
'_class'
])
if
issubclass
(
node_class
,
Queue
)
or
issubclass
(
node_class
,
Operator
):
collated
[
node_id
]
=
list
(
node_class
.
getSupportedSchedulingRules
())
return
collated
def
run
(
self
,
data
):
def
run
(
self
,
data
):
"""Preprocess the data.
"""Preprocess the data.
"""
"""
...
@@ -41,14 +51,8 @@ class ACO(plugin.ExecutionPlugin):
...
@@ -41,14 +51,8 @@ class ACO(plugin.ExecutionPlugin):
tested_ants
=
set
()
tested_ants
=
set
()
start
=
time
.
time
()
# start counting execution time
start
=
time
.
time
()
# start counting execution time
# the list of options collated into a dictionary for ease of referencing in
collated
=
self
.
createCollatedScenarios
(
data
)
# ManPy
assert
collated
collated
=
dict
()
for
node_id
,
node
in
data
[
'graph'
][
'node'
].
items
():
node_class
=
getClassFromName
(
node
[
'_class'
])
if
issubclass
(
node_class
,
Queue
)
or
issubclass
(
node_class
,
Operator
):
collated
[
node_id
]
=
list
(
node_class
.
getSupportedSchedulingRules
())
assert
collated
max_results
=
int
(
data
[
'general'
].
get
(
'numberOfSolutions'
,
0
))
max_results
=
int
(
data
[
'general'
].
get
(
'numberOfSolutions'
,
0
))
assert
max_results
>=
1
assert
max_results
>=
1
...
...
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