# Path: lib/wibbler.py
# class Wibbler(object):
#     """
#     This manages a value that wanders chaotically within a range
#     """
#     
#     def __init__(self, data):
#         self._acceleration = data[2]
#         self._velocity = 0
#         self._min = data[0]
#         self._max = data[1]
# 
#     def update(self, dt, value):
#         self._velocity += (numpy.random.random() - 0.5) * self._acceleration * dt
#         value += self._velocity * dt
# 
#         """
#         _easeFactor = 0.7
#         if value + self._velocity * dt * 10 > self._max:
#             self._acceleration *= _easeFactor
#             self._velocity *= _easeFactor
#             
#         if value + self._velocity * dt * 10 < self._min:
#             self._acceleration *= _easeFactor
#             self._velocity *= _easeFactor
#         """
#             
#         if value > self._max:
#             self._velocity = 0
#             value = self._max
#         elif value < self._min:
#             self._velocity = 0
#             value = self._min
# 
#         return value        


from builtins import str
from builtins import object
from lib.wibbler import Wibbler
import ast
import numpy

    def get(self):
        return self._value

    def get_as_str(self):
        return self._valueString

    def __cmp__(self, other):
        return (self._value == other._value)

    def set(self, value):
        if self.validate(value):
            value = self.normalize(value)
            self._wibbler = None
            self._value = value
            self._valueString = str(value)
            if self._parent is not None and self._parent.initialized:
                self._parent.parameter_changed(self)
            return True
        else:
            return False

    def set_from_str(self, valueString):
        cval = None
        try:
            cval = self._cast_from_str(valueString)
        except ValueError:
            try:
                value = ast.literal_eval(valueString)
                if len(value) == 3:

# Path: lib/wibbler.py
# class Wibbler(object):
#     """
#     This manages a value that wanders chaotically within a range
#     """
#     
#     def __init__(self, data):
#         self._acceleration = data[2]
#         self._velocity = 0
#         self._min = data[0]
#         self._max = data[1]
# 
#     def update(self, dt, value):
#         self._velocity += (numpy.random.random() - 0.5) * self._acceleration * dt
#         value += self._velocity * dt
# 
#         """
#         _easeFactor = 0.7
#         if value + self._velocity * dt * 10 > self._max:
#             self._acceleration *= _easeFactor
#             self._velocity *= _easeFactor
#             
#         if value + self._velocity * dt * 10 < self._min:
#             self._acceleration *= _easeFactor
#             self._velocity *= _easeFactor
#         """
#             
#         if value > self._max:
#             self._velocity = 0
#             value = self._max
#         elif value < self._min:
#             self._velocity = 0
#             value = self._min
# 
#         return value        


# Path: lib/parameters.py
from builtins import str
from builtins import object
from lib.wibbler import Wibbler
import ast
import numpy


    def get(self):
        return self._value

    def get_as_str(self):
        return self._valueString

    def __cmp__(self, other):
        return (self._value == other._value)

    def set(self, value):
        if self.validate(value):
            value = self.normalize(value)
            self._wibbler = None
            self._value = value
            self._valueString = str(value)
            if self._parent is not None and self._parent.initialized:
                self._parent.parameter_changed(self)
            return True
        else:
            return False

    def set_from_str(self, valueString):
        cval = None
        try:
            cval = self._cast_from_str(valueString)
        except ValueError:
            try:
                value = ast.literal_eval(valueString)
                if len(value) == 3:

                    self._wibbler = Wibbler(value)