Example #1
0
 def run_random_problem(self,
                        seed=None,
                        tau=10,
                        tau_prime=20,
                        b=2,
                        eta=0.1,
                        num_expressions=None,
                        num_input_vars=None,
                        trivial=False,
                        verbosity=0,
                        skip_real_exhaustive=False):
     problem, inputs = generate_random_problem(
         seed,
         num_expressions=num_expressions,
         num_input_vars=num_input_vars)
     result = self.run_problem(problem,
                               tau=tau,
                               tau_prime=tau_prime,
                               b=b,
                               eta=eta,
                               trivial=trivial,
                               verbosity=verbosity,
                               skip_real_exhaustive=False)
     print(generate_entire_program(inputs, problem))
     return result
Example #2
0
 def test_cost_exterior(self):
     self.MY_SEED = 101
     problem, inputs = generate_random_problem(self.MY_SEED)
     print(problem.edges)
     print(get_level_sets(problem.partial_order))
     print(generate_entire_program(inputs, problem))
     print(list(problem.partial_order.edges))
Example #3
0
 def test_cost_small_vars_many_expressions(self):
     self.MY_SEED = 101
     problem, inputs = generate_random_problem(self.MY_SEED, 20, 4)
     print(problem.edges)
     print(get_level_sets(problem.partial_order))
     print(generate_entire_program(inputs, problem))
     print(list(problem.partial_order.edges))
    def test_problem_supplied_size_four_tests(self):
        self.MY_SEED = 101
        num_expressions = 80
        num_input_vars = 30
        problem, inputs = generate_random_problem(self.MY_SEED, num_expressions, num_input_vars)

        print(problem.edges)
        print(get_level_sets(problem.partial_order))
        print(generate_entire_program(inputs, problem))
        print(list(problem.partial_order.edges))
        run_four_tests([], [], verbosity=1, prob=problem, skip_real_exhaustive=True)