Ejemplo n.º 1
0
def main():
    common_classes = CommonClassesCreator(False)

    length, epsilon, mutation_neighborhood, tolerance = common_classes.get_common_classes()

    concept_class = MonotoneConjunction(length)
    performance = common_classes.get_perf_without_precomp(concept_class)
    mutation_probability = common_classes.get_mutation_probability()

    mutator = Mutator(mutation_neighborhood, performance, tolerance, mutation_probability, epsilon)
    algorithm = ConjunctionEvolvabilityAlgorithm(mutator, length, epsilon, performance)

    hypo = algorithm.learn_ideal_function(epsilon)

    print "HYPO IS: " + str(hypo)
Ejemplo n.º 2
0
def recombination_main():
    common_classes = CommonClassesCreator()

    length, epsilon, mutation_neighborhood, tolerance = common_classes.get_common_classes()

    mutation_factor = 0.1

    concept_class = MonotoneConjunction(length)
    performance = common_classes.get_perf_without_precomp(concept_class)

    recomb_process = RecombinationProcess()
    neighborhood = NeighborhoodWithOtherRepresentations(length, mutation_neighborhood,
                                                        mutation_factor, recomb_process)
    recombinator = Recombinator(neighborhood, performance, tolerance, epsilon)
    recombination = RecombinationConjunctionAlgorithm(recombinator, length, epsilon, concept_class)

    recombination.learn_ideal_function(concept_class)
Ejemplo n.º 3
0
def HGT_main():
    common_classes = CommonClassesCreator()

    length, epsilon, mutation_neighborhood, tolerance = common_classes.get_common_classes()
    mutation_factor = 0.1
    HGT_factor = 1

    concept_class = MonotoneConjunction(length)
    performance = common_classes.get_perf_without_precomp(concept_class)

    HGT_process = HGTProcess(HGT_factor, length)
    neighborhood = NeighborhoodWithOtherRepresentations(length, mutation_neighborhood,
                                                        mutation_factor, HGT_process)
    HGT_mutator = HGT_Mutator(neighborhood, performance, tolerance, epsilon, HGT_process)
    mutation = HGTConjunctionAlgorithm(HGT_mutator, length, epsilon, performance)

    final_population = mutation.learn_ideal_function(concept_class)

    if len(final_population) <= 30:
        print final_population