Exemplo n.º 1
0
  def testComputeFitnessDOA(self):
    root = Node("=")
    root.left = Node("x")
    root.right = Node("4")

    program = Program(root)

    fitness = FitCurveProblem.computeFitness(program)
    self.assertEqual(fitness, 0.019999999732933336)
Exemplo n.º 2
0
  def testComputeFitnessLow(self):
    root = Node("=")
    root.left = Node("y")
    root.right = Node("4")

    program = Program(root)

    fitness = FitCurveProblem.computeFitness(program)
    self.assertEqual(fitness, 8.14518041038435)
Exemplo n.º 3
0
    def testComputeFitnessDOA(self):
        root = Node("=")
        root.left = Node("x")
        root.right = Node("4")

        program = Program(root)

        fitness = FitCurveProblem.computeFitness(program)
        self.assertEqual(fitness, 0.019999999732933336)
Exemplo n.º 4
0
    def testComputeFitnessLow(self):
        root = Node("=")
        root.left = Node("y")
        root.right = Node("4")

        program = Program(root)

        fitness = FitCurveProblem.computeFitness(program)
        self.assertEqual(fitness, 8.14518041038435)
Exemplo n.º 5
0
  def testComputeFitnessHigh(self):
    root = Node("=")
    root.left = Node("y")
    root.right = Node("+")
    root.right.left = Node("x")
    root.right.right = Node("4")

    program = Program(root)

    fitness = FitCurveProblem.computeFitness(program)
    self.assertEqual(fitness, 100)
Exemplo n.º 6
0
    def testComputeFitnessHigh(self):
        root = Node("=")
        root.left = Node("y")
        root.right = Node("+")
        root.right.left = Node("x")
        root.right.right = Node("4")

        program = Program(root)

        fitness = FitCurveProblem.computeFitness(program)
        self.assertEqual(fitness, 100)