from algorithm import algorithm
import json


class excursion(algorithm):
    def __init__(self):
        self.config_dict_ = None
        self.config_ = None
        self.amplitude_base_ = 0.0

    def set_config(self, config):
        self.config_ = config
        self.config_dict_ = json.loads(self.config_)
        self.amplitude_base_ = self.config_dict_["STEP_AMPLITUDE_BASE"]

    def config(self):
        return self.config_

    def eval(self, value):
        return value + self.amplitude_base_
