python模拟生物进化和遗传算法
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134#-*- coding:utf-8 -*-from PIL import Image as im from os import path from math import log from random import randint from copy import deepcopy import pickle as pk #全局变量 quanju_v = {} #定义图片预处理函数 def process_pic(pic_name): print("开始预处理图片") #获得图片对象 img = im.open(pic_name) #获得图片的规格 img_color = [] img_width,img_height = img.size i = 1 for x in range(img_height): img_color_tmp = [] for y in range(img_width): #获得图片像
...