aboutsummaryrefslogtreecommitdiff
path: root/bestflags/genetic_algorithm.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/genetic_algorithm.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/genetic_algorithm.py')
-rw-r--r--bestflags/genetic_algorithm.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/bestflags/genetic_algorithm.py b/bestflags/genetic_algorithm.py
index 56b1dcc1..0e7de07f 100644
--- a/bestflags/genetic_algorithm.py
+++ b/bestflags/genetic_algorithm.py
@@ -200,7 +200,7 @@ class GAGeneration(Generation):
Generation.__init__(self, tasks, parents)
self._total_stucks = total_stucks
- def Improve(self):
+ def Improved(self):
"""True if this generation has improvement upon its parent generation."""
tasks = self.Pool()
@@ -216,7 +216,7 @@ class GAGeneration(Generation):
best_current = sorted(tasks, key=lambda task: task.GetTestResult())[0]
# At least one task has improvement.
- if best_current.Improve(best_parent):
+ if best_current.Improved(best_parent):
self._total_stucks = 0
return True