From 2b514c28dd26aa02c2ea0f9924be91fb2394c8a0 Mon Sep 17 00:00:00 2001 From: Yuheng Long Date: Thu, 8 Aug 2013 21:07:24 -0700 Subject: 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 Commit-Queue: Yuheng Long Tested-by: Yuheng Long --- bestflags/genetic_algorithm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bestflags/genetic_algorithm.py') 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 -- cgit v1.2.3