Enable strategy parameters

Strategy provides parameters to customize algorithm behavior. End user
could query then specify parameters for their requirements.

Change-Id: Id097db5f6e79c94b57674c8e5d55b06098abf18c
Implements-bp: optimization-threshold
This commit is contained in:
Edwin Zhai
2016-03-17 01:50:39 +00:00
parent ec64203bee
commit 0b29a8394b
16 changed files with 209 additions and 13 deletions

View File

@@ -41,6 +41,7 @@ import six
from watcher.common import clients
from watcher.common.loader import loadable
from watcher.common import utils
from watcher.decision_engine.loading import default as loading
from watcher.decision_engine.solution import default
from watcher.decision_engine.strategy.common import level
@@ -76,6 +77,7 @@ class BaseStrategy(loadable.Loadable):
self._collector_manager = None
self._model = None
self._goal = None
self._input_parameters = utils.Struct()
@classmethod
@abc.abstractmethod
@@ -176,6 +178,23 @@ class BaseStrategy(loadable.Loadable):
return self._model
@classmethod
def get_schema(cls):
"""Defines a Schema that the input parameters shall comply to
:return: A jsonschema format (mandatory default setting)
:rtype: dict
"""
return {}
@property
def input_parameters(self):
return self._input_parameters
@input_parameters.setter
def input_parameters(self, p):
self._input_parameters = p
@property
def osc(self):
if not self._osc: