# Path: Optimizers/GeneticAlgorithm.py
# class GeneticAlgorithm(Optimizer):
#     """
#     This class contains a generic implementation of the Genetic Algorithm. It uses Selection, Mutation, and Crossover
#     objects to evolve a population of candidate solutions to a particular optimization problem.
#     """
# 
#     def __init__(self, problem, parameters=None):
#         """
#         Initialization method for the Genetic Algorithm
#         :param problem:
#         :param parameters[0]: Crossover rate (% of the population which is used in crossover)
#         :param parameters[1]: Crossover strategy e.g. sexual, asexual
#         :param parameters[2]: Mutation rate (% of the population which is mutated)
#         :param parameters[3]: Mutator strategy e.g. Brownian Individuals
#         :param parameters[4]: Selection rate (% of the population to be culled)
#         :param parameters[5]: Selection strategy e.g. Rank Selection vs. Random Selection
#         :param parameters[6]: Population size # individuals.
#         """
#         if parameters is None:
#             parameters = [0.5, "sexual", 0.05, "brownian", 0.5, "rank", 50]
#         super(GeneticAlgorithm, self).__init__(problem, parameters)
#         self.population = []
#         for i in range(parameters[6]):
#             random_solution = random.sample(xrange(problem.lower_bound, problem.upper_bound), problem.dimension)
#             self.population.append(Individual(random_solution, problem))
# 
#     def optimize(self, iterations=1000, stopping=True):
#         pass
# 
#     def select(self):
#         pass
# 
#     def crossover(self):
#         pass
# 
#     def mutate(self):
#         pass
# 
# 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


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

"""
File description
"""


__author__ = 'stuartreid'



# Path: Optimizers/GeneticAlgorithm.py
# class GeneticAlgorithm(Optimizer):
#     """
#     This class contains a generic implementation of the Genetic Algorithm. It uses Selection, Mutation, and Crossover
#     objects to evolve a population of candidate solutions to a particular optimization problem.
#     """
# 
#     def __init__(self, problem, parameters=None):
#         """
#         Initialization method for the Genetic Algorithm
#         :param problem:
#         :param parameters[0]: Crossover rate (% of the population which is used in crossover)
#         :param parameters[1]: Crossover strategy e.g. sexual, asexual
#         :param parameters[2]: Mutation rate (% of the population which is mutated)
#         :param parameters[3]: Mutator strategy e.g. Brownian Individuals
#         :param parameters[4]: Selection rate (% of the population to be culled)
#         :param parameters[5]: Selection strategy e.g. Rank Selection vs. Random Selection
#         :param parameters[6]: Population size # individuals.
#         """
#         if parameters is None:
#             parameters = [0.5, "sexual", 0.05, "brownian", 0.5, "rank", 50]
#         super(GeneticAlgorithm, self).__init__(problem, parameters)
#         self.population = []
#         for i in range(parameters[6]):
#             random_solution = random.sample(xrange(problem.lower_bound, problem.upper_bound), problem.dimension)
#             self.population.append(Individual(random_solution, problem))
# 
#     def optimize(self, iterations=1000, stopping=True):
#         pass
# 
#     def select(self):
#         pass
# 
#     def crossover(self):
#         pass
# 
#     def mutate(self):
#         pass
# 
# 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: Classifiers/GeneticProgramming.py
from Optimizers.GeneticAlgorithm import GeneticAlgorithm
from Optimizers.Solution import Solution

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

"""
File description
"""


__author__ = 'stuartreid'



class GeneticProgramming(GeneticAlgorithm):