aboutsummaryrefslogtreecommitdiff
path: root/bestflags/generation.py
diff options
context:
space:
mode:
authorYuheng Long <yuhenglong@google.com>2013-08-02 14:27:45 -0700
committerChromeBot <chrome-bot@google.com>2013-08-07 12:43:42 -0700
commitccfaf2f382815945c1c883e1cfceb2eba55e28b0 (patch)
tree3e05a3bc1b30c0118ee11d705ba94ec7ceb6c999 /bestflags/generation.py
parent6aa8528c03697a1f28186c574d512c19935676a5 (diff)
downloadtoolchain-utils-ccfaf2f382815945c1c883e1cfceb2eba55e28b0.tar.gz
Add the best branching hill climbing algorithm.
BUG=None TEST=unit testings for the pipeline stage, pipeline workers, generation, steering, task, flag and hill climbing. Change-Id: Ifd181f45c4b82f5fb77b0d4946757954aa806d33 Reviewed-on: https://gerrit-int.chromium.org/42284 Tested-by: Yuheng Long <yuhenglong@google.com> Reviewed-by: Simon Que <sque@google.com> Commit-Queue: Yuheng Long <yuhenglong@google.com>
Diffstat (limited to 'bestflags/generation.py')
-rw-r--r--bestflags/generation.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/bestflags/generation.py b/bestflags/generation.py
index 7f0e94a1..0bc2f57c 100644
--- a/bestflags/generation.py
+++ b/bestflags/generation.py
@@ -107,19 +107,24 @@ class Generation(object):
return True
def Improve(self):
- """True if this generation has improvement over its parent generation.
+ """True if this generation has improvement upon its parent generation.
Raises:
NoneOverridingError: The subclass should override this method.
"""
raise NoneOverridingError('Must be implemented by child class')
- def Next(self):
+ def Next(self, _):
"""Calculate the next generation.
This is the core of the framework implementation. It must be overridden by
the concrete subclass to implement algorithm specific generations.
+ Args:
+ _: A set of tasks that have been generated before. The overridden method
+ in the subclasses can use this so as not to generate task that has been
+ generated before.
+
Returns:
A set of new generations.