Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
User expired
2018s-advanced-distributed-systems
Commits
134f3c30
Verified
Commit
134f3c30
authored
Dec 10, 2018
by
Löscher Mario
Browse files
update
parent
e0b5c891
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
scheduler/preprocessing.py
scheduler/preprocessing.py
+4
-3
No files found.
scheduler/preprocessing.py
View file @
134f3c30
...
...
@@ -175,7 +175,7 @@ def best_performance_under_limit(
index
+=
1
max_price
=
5
#
max_price =
1
#write solution
current_price
=
max_price
current_solution
[
solutions_machine
[
max_price_position
]]
=
math
.
ceil
(
solutions_hours
[
max_price_position
]
/
3600
*
prices
[
solutions_machine
[
max_price_position
]])
...
...
@@ -192,7 +192,8 @@ def best_performance_under_limit(
#if new_runtime > getMinRuntime(batch_durations, index):
# new_runtime = getMinRuntime(batch_durations, index)
new_price
=
math
.
ceil
(
solution
/
3600
/
factor
)
*
prices
[
solutions_machine
[
index
]]
*
factor
if
(
new_runtime
<
solutions_hours
[
max_price_position
]
*
0.9
):
# 0.9 to simulate the traffic time needed to transfer
#if (new_runtime < solutions_hours[max_price_position] * 0.9): # 0.9 to simulate the traffic time needed to transfer
if
(
new_price
<
current_price
):
current_price
=
new_price
solutions_hours
[
index
]
/=
factor
current_solution
=
[
0
for
machine
in
prices
]
...
...
@@ -200,7 +201,7 @@ def best_performance_under_limit(
current_solution
[
solutions_machine
[
index
]]
=
factor
*
math
.
ceil
(
solutions_hours
[
index
]
/
3600
)
index
+=
1
print
(
"final duration[s]: "
+
str
(
solutions_hours
[
max_price_position
]))
print
(
"final duration[s]: "
+
str
(
solutions_hours
[
max_price_position
]
/
current_solution
[
solutions_machine
[
max_price_position
]]
))
# The calculation only uses homogeneous VM distribution currently
...
...
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