# Path: Optimizers/Solution.py
# class Solution(object):
#     solution = []
# 
#     def __init__(self, solution, problem):
#         """
#         Abstract initialization method for a solution to some optimization function
#         :param solution: a numpy array (much faster than lists)
#         """
#         self.solution = solution
#         self.problem = problem
#         return
# 
#     def __len__(self):
#         """
#         Overload of the len operator for the Solution class
#         :rtype : Sized?
#         """
#         return len(self.solution)
# 
#     def update(self, solution):
#         """
#         This method is used for updating a solution
#         """
#         self.solution = solution
# 
#     def get(self):
#         """
#         This method is used to retrieve the numpy array for direct manipulation
#         """
#         return self.solution
# 
#     def evaluate(self):
#         return self.problem.evaluate(self.solution)
# 
#     def __gt__(self, other):
#         assert isinstance(other, Solution)
#         if self.problem.optimization is "min":
#             return self.evaluate() < other.evaluate()
#         elif self.problem.optimization is "max":
#             return self.evaluate() > other.evaluate()
# 
#     def deep_copy(self):
#         copy = Solution(None, self.problem)
#         copy.solution = []
#         for i in range(len(self.solution)):
#             copy.solution.append(self.solution[i])
#         return copy
# 
# Path: Problems/Cigar.py
# class Cigar(Problem):
# 
#     def __init__(self, dimension, upper_bound, lower_bound, optimization="min"):
#         super(Cigar, self).__init__(dimension, upper_bound, lower_bound, optimization)
# 
#     def evaluate(self, candidate):
#         """
#         LaTeX: f_{\textrm{Cigar}}(\textbf{x}) = x_0^2 + \sum_{i=1}^N x^2_i
#         """
#         value = 0
#         for i in xrange(0, self.dimension):
#             value += candidate[i] ** 2
#             #ToDo: move this out into the Abstract base class and force call
#             if candidate[i] > self.upper_bound or candidate < self.lower_bound:
#                 if self.optimization is "min":
#                     value = float("+inf")
#                     break
#                 elif self.optimization is "max":
#                     value = float("-inf")
#                     break
#         return value


import random
import profile
from Optimizers.Solution import Solution
from Problems.Cigar import Cigar
__author__ = 'Stuart Gordon Reid'
__email__ = 'stuartgordonreid@gmail.com'
__website__ = 'http://www.stuartreid.co.za'

"""
File description
"""




# Path: Optimizers/Solution.py
# class Solution(object):
#     solution = []
# 
#     def __init__(self, solution, problem):
#         """
#         Abstract initialization method for a solution to some optimization function
#         :param solution: a numpy array (much faster than lists)
#         """
#         self.solution = solution
#         self.problem = problem
#         return
# 
#     def __len__(self):
#         """
#         Overload of the len operator for the Solution class
#         :rtype : Sized?
#         """
#         return len(self.solution)
# 
#     def update(self, solution):
#         """
#         This method is used for updating a solution
#         """
#         self.solution = solution
# 
#     def get(self):
#         """
#         This method is used to retrieve the numpy array for direct manipulation
#         """
#         return self.solution
# 
#     def evaluate(self):
#         return self.problem.evaluate(self.solution)
# 
#     def __gt__(self, other):
#         assert isinstance(other, Solution)
#         if self.problem.optimization is "min":
#             return self.evaluate() < other.evaluate()
#         elif self.problem.optimization is "max":
#             return self.evaluate() > other.evaluate()
# 
#     def deep_copy(self):
#         copy = Solution(None, self.problem)
#         copy.solution = []
#         for i in range(len(self.solution)):
#             copy.solution.append(self.solution[i])
#         return copy
# 
# Path: Problems/Cigar.py
# class Cigar(Problem):
# 
#     def __init__(self, dimension, upper_bound, lower_bound, optimization="min"):
#         super(Cigar, self).__init__(dimension, upper_bound, lower_bound, optimization)
# 
#     def evaluate(self, candidate):
#         """
#         LaTeX: f_{\textrm{Cigar}}(\textbf{x}) = x_0^2 + \sum_{i=1}^N x^2_i
#         """
#         value = 0
#         for i in xrange(0, self.dimension):
#             value += candidate[i] ** 2
#             #ToDo: move this out into the Abstract base class and force call
#             if candidate[i] > self.upper_bound or candidate < self.lower_bound:
#                 if self.optimization is "min":
#                     value = float("+inf")
#                     break
#                 elif self.optimization is "max":
#                     value = float("-inf")
#                     break
#         return value


# Path: Optimizers/BrownianSolution.py
import random
import profile
from Optimizers.Solution import Solution
from Problems.Cigar import Cigar

__author__ = 'Stuart Gordon Reid'
__email__ = 'stuartgordonreid@gmail.com'
__website__ = 'http://www.stuartreid.co.za'

"""
File description
"""




class BrownianSolution(Solution):