def __init__(self, is_neigh_precomp=True): self.length = 40 self.epsilon = 2**-31 self.number_of_activations = 10 self.number_of_mutations_from_mutator = 40 self.population_size = 200 self.tolerance = ConjunctionTolerance(self.length, self.epsilon) self.tau = (self.epsilon / self.length)**3 * log(1/self.epsilon) self.representation_class = None if is_neigh_precomp: self.representation_class = get_set_of_all_representations_with_length(self.length) self.mutation_neighborhood = PrecompMonotoneConjunctionNeighborhood(self.representation_class) else: self.mutation_neighborhood = MonotoneConjunctionNeighborhood() self.mutation_probability = ConjunctionMutationProbability(self.mutation_neighborhood)
def get_perf(self, concept_class): if self.representation_class is None: self.representation_class = get_set_of_all_representations_with_length(self.length) return PerformanceOracleWithPrecomp(concept_class, self.tau, self.representation_class)