X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;ds=inline;f=conductor%2Fconductor%2Fsolver%2Foptimizer%2Fgreedy.py;h=5c82164c5e93abbe650fce8b7f2263cacd5f5cd2;hb=f7a27497dd184da6259ea8bd87c3c704df519923;hp=eae1b122c722186a85b70293293753040097fad4;hpb=11f579c76967eec1c4959ba02dbdfc6f19575a84;p=optf%2Fhas.git diff --git a/conductor/conductor/solver/optimizer/greedy.py b/conductor/conductor/solver/optimizer/greedy.py index eae1b12..5c82164 100755 --- 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) 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. @@ -55,6 +56,10 @@ class Greedy(search.Search): 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