Code Review
/
optf
/
has.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Add support to generic optimization structure
[optf/has.git]
/
conductor
/
conductor
/
solver
/
optimizer
/
greedy.py
diff --git
a/conductor/conductor/solver/optimizer/greedy.py
b/conductor/conductor/solver/optimizer/greedy.py
index
eae1b12
..
5c82164
100755
(executable)
--- a/
conductor/conductor/solver/optimizer/greedy.py
+++ b/
conductor/conductor/solver/optimizer/greedy.py
@@
-2,6
+2,7
@@
#
# -------------------------------------------------------------------------
# Copyright (c) 2015-2017 AT&T Intellectual Property
#
# -------------------------------------------------------------------------
# Copyright (c) 2015-2017 AT&T Intellectual Property
+# Copyright (C) 2020 Wipro Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@
-55,6
+56,10
@@
class Greedy(search.Search):
if decision_path.total_value < bound_value:
bound_value = decision_path.total_value
best_resource = candidate
if decision_path.total_value < bound_value:
bound_value = decision_path.total_value
best_resource = candidate
+ elif _objective.goal == "max":
+ if decision_path.total_value > bound_value:
+ bound_value = decision_path.total_value
+ best_resource = candidate
if best_resource is not None:
decision_path.decisions[demand.name] = best_resource
if best_resource is not None:
decision_path.decisions[demand.name] = best_resource