aboutsummaryrefslogtreecommitdiff
path: root/bestflags/hill_climb_best_neighbor.py
diff options
context:
space:
mode:
authorYuheng Long <yuhenglong@google.com>2013-08-08 21:07:24 -0700
committerChromeBot <chrome-bot@google.com>2013-08-10 20:26:39 -0700
commit2b514c28dd26aa02c2ea0f9924be91fb2394c8a0 (patch)
treee2a9532a20096b0f22b0ee838dbccd364e09027f /bestflags/hill_climb_best_neighbor.py
parentbbbd8645405a7058b8e6d17dc1fdec14cbff4f08 (diff)
downloadtoolchain-utils-2b514c28dd26aa02c2ea0f9924be91fb2394c8a0.tar.gz
Add more examples for better documentation.
BUG=None TEST=unit testings for the pipeline stage, pipeline workers, generation, steering, task, flag and hill climbing. Change-Id: I1f8f361388d3c3171a7135d1d0ef38ee5f695829 Reviewed-on: https://gerrit-int.chromium.org/42584 Reviewed-by: Luis Lozano <llozano@chromium.org> Commit-Queue: Yuheng Long <yuhenglong@google.com> Tested-by: Yuheng Long <yuhenglong@google.com>
Diffstat (limited to 'bestflags/hill_climb_best_neighbor.py')
-rw-r--r--bestflags/hill_climb_best_neighbor.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/bestflags/hill_climb_best_neighbor.py b/bestflags/hill_climb_best_neighbor.py
index 5bc3f7ed..aec420f9 100644
--- a/bestflags/hill_climb_best_neighbor.py
+++ b/bestflags/hill_climb_best_neighbor.py
@@ -41,7 +41,7 @@ class HillClimbingBestBranch(Generation):
Generation.__init__(self, exe_pool, parents)
self._specs = specs
- def Improve(self):
+ def Improved(self):
"""True if this generation has improvement over its parent generation.
Returns:
@@ -51,7 +51,7 @@ class HillClimbingBestBranch(Generation):
# Find the best neighbor.
best_task = None
for task in self._exe_pool:
- if not best_task or task.Improve(best_task):
+ if not best_task or task.Improved(best_task):
best_task = task
if not best_task:
@@ -63,7 +63,7 @@ class HillClimbingBestBranch(Generation):
assert len(parents) == 1
self._next_task = best_task
# If the best neighbor improves upon the parent task.
- return best_task.Improve(parents[0])
+ return best_task.Improved(parents[0])
self._next_task = best_task
return True