def __init__(self, num_populated_areas, num_power_plants): GenomeBase.__init__(self) self.proposed_distribution = None self.num_populated_areas = num_populated_areas self.num_power_plants = num_power_plants self.initializator.set(proposed_distribution_initializator) self.mutator.set(proposed_distribution_mutator) self.crossover.set(proposed_distribution_crossover)
def __init__(self, keys, values, cloning=False, **kwargs): nstates = kwargs.get('nstates', o.ga.genomes.gmap.nstates) GenomeBase.__init__(self) GMapBase.__init__(self, keys, values, nstates) if not cloning: self.initializator.set(GMapInitializator) self.mutator.set(GMapMutator) self.crossover.set(GMapCrossoverSinglePoint) self.evaluator.set(GMapEvaluator)
def __init__(self, loss_network): GenomeBase.__init__(self) self.proposed_distribution = None self.loss_network = loss_network self.num_populated_areas = len(loss_network) self.num_power_plants = len(loss_network[0]) self.initializator.set(proposed_distribution_initializator) self.mutator.set(proposed_distribution_mutator) self.crossover.set(proposed_distribution_crossover)
def __init__(self, size): """ The initializator of G1DListModified representation, size parameter must be specified """ GenomeBase.__init__(self) self.genomeList = [] self.listSize = size self.initializator.set(Consts.CDefG1DListInit) self.mutator.set(Consts.CDefG1DListMutator) self.crossover.set(Consts.CDefG1DListCrossover)
def __init__(self, height, width, depth): GenomeBase.__init__(self) self.gens = np.zeros((height, width, depth)) self.height = height self.width = width self.depth = depth
def __init__(self, size): """ The initializator of G1DListModified representation, size parameter must be specified """ GenomeBase.__init__(self) self.genomeList = [] self.listSize = size self.initializator.set(Consts.CDefG1DListInit) self.mutator.set(Consts.CDefG1DListMutator) self.crossover.set(Consts.CDefG1DListCrossover)
def __init__(self, rule_length): GenomeBase.__init__(self) self.ruleSet = G1DBinaryString(0) self.rulePartition = [] self.ruleSetSize = 0 self.rule_length = rule_length self.examples = [] self.initializator.set(GD1BinaryStringSetInitializator) self.mutator.set(WG1DBinaryStringSetMutatorFlip) self.crossover.set(G1DBinaryStringSetXTwoPoint) self.accuracy = 0.0
def __init__(self, size=10, cloning=False): """ The initializator of G1DConnections representation, size parameter must be specified """ GenomeBase.__init__(self) G1DBase.__init__(self, size) genomeList=None # self.genomeList=np.empty((3,size),dtype=[('from','i'),('to','i'),('weight','f')]) if not cloning: self.initializator.set(GAnnConsts.CDefG1DConnInit) self.mutator.set(GAnnConsts.CDefG1DConnMutator) self.crossover.set(GAnnConsts.CDefG1DConnCrossover)
def __init__(self,rule_length): GenomeBase.__init__(self) self.ruleSet = G1DBinaryString(0) self.rulePartition = [] self.ruleSetSize = 0 self.rule_length = rule_length self.examples = [] self.initializator.set(GD1BinaryStringSetInitializator) self.mutator.set(WG1DBinaryStringSetMutatorFlip) self.crossover.set(G1DBinaryStringSetXTwoPoint) self.accuracy = 0.0
def __init__(self, target): GenomeBase.__init__(self) self.width, self.height = target.target.size self.target = target self.shapes= [] self.bg=(0,0,0)