Exemple #1
0
def create_new_individual(config:Config):
    # genome = {"weights": [1, random.random(), 1, random.random(), 0, 1, random.random(), 1],
    #           "biases": [0, random.random(), 0, 0, 2, random.random(), 0, 0, ]}
    id = next(config.global_individ_id_counter)
    genome = create_new_genome(id, config= config)
    individual = Individ(id=id, genome=genome)
    return individual
def create_new_individual(config: Config):
    genome = create_new_genome(config=config)
    # genome = {"weights": [], "biases": []}
    # for chromosome in genome:
    #     for i in range(8):
    #         genome[chromosome].append(random.uniform(genome_value_min, genome_value_max))
    #     # genome[chromosome].append(random.uniform(genome_value_min, genome_value_max))
    individual = Individ(id= next(config.global_individ_id_counter), genome = genome)
    return individual