示例#1
0
    def setUp(self):
        self.problem = EmptyProblem()
        self.sequential = Sequential([
            PopulationOnePointCrossover(c_rate=1),
            TournamentSelection(k=10, tournament_size=3, problem=self.problem)
        ])
        self.initializer = PopulationRandomInitializer(k=10,
                                                       t_prob=0.5,
                                                       max_depth=3,
                                                       problem=self.problem)

        self.terminal_condition = TerminalCondition([GenerationTerminator(10)])
示例#2
0
 def setUp(self):
     ExampleSolution.__init__(self)
     self.problem = EmptyProblem()
     self.pop = [solution.Solution(node.Node()) for _ in range(100)]
示例#3
0
 def setUp(self):
     ExampleSolution.__init__(self)
     self.problem = EmptyProblem()
     self.mutation = mu.PointMutation(1.0, problem=self.problem, mutation_type='onepoint')
示例#4
0
 def setUp(self):
     self.root_id = 0
     ExampleSolution.__init__(self, root_id=self.root_id)
     self.problem = EmptyProblem()
示例#5
0
 def setUp(self):
     ExampleSolutions.__init__(self)
     self.tournament_size = 2
     self.k = 3
     self.problem = EmptyProblem()
示例#6
0
 def setUp(self):
     ExampleSolutions.__init__(self)
     self.k = 3
     self.problem = EmptyProblem()