【Python】人工智能-机器学习——不调库手撕演化算法解决函数最小值问题

本文主要是介绍【Python】人工智能-机器学习——不调库手撕演化算法解决函数最小值问题,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

1 作业内容描述

1.1 背景

  1. 现在有一个函数 3 − s i n 2 ( j x 1 ) − s i n 2 ( j x 2 ) 3-sin^2(jx_1)-sin^2(jx_2) 3sin2(jx1)sin2(jx2),有两个变量 x 1 x_1 x1 x 2 x_2 x2,它们的定义域为 x 1 , x 2 ∈ [ 0 , 6 ] x_1,x_2\in[0,6] x1,x2[0,6],并且 j = 2 j=2 j=2,对于此例,所致对于 j = 2 , 3 , 4 , 5 j=2,3,4,5 j=2,3,4,5分别有 16,36,64,100 个全局最优解。

  2. 现在有一个Shubert函数 ∏ i = 1 n ∑ j = 1 5 j cos ⁡ [ ( j + 1 ) x i + j ] \prod_{i=1}^{n}\sum_{j=1}^{5}j\cos[(j+1)x_i+j] i=1nj=15jcos[(j+1)xi+j],其中定义域为 − 10 < x i < 10 -10<x_i<10 10<xi<10,对于此问题,当n=2时有18个不同的全局最优解

1.2 要求

  1. 求该函数的最小值即 m i n ( 3 − s i n 2 ( j x 1 ) − s i n 2 ( j x 2 ) ) min(3-sin^2(jx_1)-sin^2(jx_2)) min(3sin2(jx1)sin2(jx2)),j=2,精确到小数点后6位。
  2. 求该Shubert函数的最小值即 m i n ( ∏ i = 1 2 ∑ j = 1 5 j cos ⁡ [ ( j + 1 ) x i + j ] ) min(\prod_{i=1}^{2}\sum_{j=1}^{5}j\cos[(j+1)x_i+j]) min(i=12j=15jcos[(j+1)xi+j]),精确到小数点后6位

2 作业已完成部分和未完成部分

该作业已经全部完成,没有未完成的部分。

Value在这里插入图片描述
Colab NotebookGithub Rep

3. 作业运行结果截图

最后跑出的结果如下:

  1. 第一个函数的最小值为 1.0000000569262162
  2. 第二个函数的最小值为-186.73042323192567

4 核心代码和步骤

4.1 基本的步骤

  1. 定义目标函数 objective_function:使用了一个二维的目标函数,即 3 − s i n 2 ( j x 1 ) − s i n 2 ( j x 2 ) 3-sin^2(jx_1)-sin^2(jx_2) 3sin2(jx1)sin2(jx2)
  2. 定义选择函数 crossover:用于交叉操作,通过交叉率(crossover_rate)确定需要进行交

叉的父母对的数量,并在这些父母对中交换某些变量的值。

  1. 定义变异函数 mutate:用于变异操作,通过变异率(mutation_rate)确定需要进行变异

的父母对的数量,并在这些父母对中随机改变某些变量的值。

  1. 定义进化算法 evolutionary_algorithm:初始化种群,其中每个个体都是一个二维向量。在

每一代中,计算每个个体的适应度值,绘制三维图表展示种群分布和最佳解。

  1. 更新全局最佳解。根据适应度值确定复制的数量并形成繁殖池。选择父母、进行交叉和变

异,更新种群。重复上述步骤直到达到指定的迭代次数。

  1. 设置算法参数:population_size:种群大小。;num_generations:迭代的次数。;muta

tion_rate:变异率。;crossover_rate:交叉率。

  1. 运行进化算法 evolutionary_algorithm:调用进化算法函数并获得最终的最佳解、最佳适

应度值和每一代的演化数据。

  1. 输出结果:打印最终的最佳解和最佳适应度值。输出每个迭代步骤的最佳适应度值。

  2. 可视化结果:绘制函数曲面和最优解的三维图表。绘制适应度值随迭代次数的变化曲线。

4.2 第一个函数 3 − s i n 2 ( j x 1 ) − s i n 2 ( j x 2 ) 3-sin^2(jx_1)-sin^2(jx_2) 3sin2(jx1)sin2(jx2)

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt# 定义目标函数
def objective_function(x):j = 2return 3 - np.sin(j * x[0])**2 - np.sin(j * x[1])**2 # 3 - sin(2x1)^2 - sin(2x2)^2# 定义选择函数
def crossover(parents_1, parents_2, crossover_rate):num_parents = len(parents_1) # 父母的数量 num_crossover = int(crossover_rate * num_parents) # 选择进行交叉的父母对的数量# 选择进行交叉的父母对crossover_indices = np.random.choice(num_parents, size=num_crossover, replace=False) # 选择进行交叉的父母对的索引# 复制父母copy_parents_1 = np.copy(parents_1)copy_parents_2 = np.copy(parents_2)# 进行交叉操作for i in crossover_indices:parents_1[i][1] = copy_parents_2[i][1] # 交叉变量x2parents_2[i][1] = copy_parents_1[i][1] # 交叉变量x2return parents_1, parents_2# 定义变异函数
def mutate(parents_1, parents_2, mutation_rate):num_parents = len(parents_1) # 父母的数量num_mutations = int(mutation_rate * num_parents) # 选择进行变异的父母对的数量# 选择进行变异的父母对mutation_indices = np.random.choice(num_parents, size=num_mutations, replace=False) # 选择进行变异的父母对的索引# 进行变异操作for i in mutation_indices:parents_1[i][1] = np.random.uniform(0, 6)  # 变异变量x2parents_2[i][1] = np.random.uniform(0, 6)  # 变异变量x2return parents_1, parents_2# 定义进化算法
def evolutionary_algorithm(population_size, num_generations, mutation_rate, crossover_rate):bounds = [(0, 6), (0, 6)]  # 变量的取值范围# 保存每个迭代步骤的信息evolution_data = []# 初始化种群population = np.random.uniform(bounds[0][0], bounds[0][1], size=(population_size, 2))# 设置初始的 best_solutionbest_solution = population[0]  # 选择种群中的第一个个体作为初始值best_fitness = objective_function(best_solution) # 计算初始值的适应度值for generation in range(num_generations):# 计算适应度fitness_values = np.apply_along_axis(objective_function, 1, population)# 找到当前最佳解current_best_index = np.argmin(fitness_values)current_best_solution = population[current_best_index]current_best_fitness = fitness_values[current_best_index]# 绘制每次迭代的三维分布图fig = plt.figure() # 创建一个新的图形ax = fig.add_subplot(111, projection='3d') # 创建一个三维的坐标系ax.scatter(population[:, 0], population[:, 1], fitness_values, color='black', marker='.', label='Population') # 绘制种群的分布图ax.scatter(best_solution[0], best_solution[1], best_fitness, s=100, color='red', marker='o', label='Best Solution') # 绘制最佳解的分布图# 设置坐标轴的标签ax.set_xlabel('X1') ax.set_ylabel('X2')ax.set_zlabel('f(x)')ax.set_title(f'Generation {generation} - Best Fitness: {best_fitness:.6f}')ax.legend() # 显示图例plt.show() # 显示图形# 更新全局最佳解if current_best_fitness < best_fitness: # 如果当前的最佳解的适应度值小于全局最佳解的适应度值best_solution = current_best_solutionbest_fitness = current_best_fitness# 保存当前迭代步骤的信息evolution_data.append({'generation': generation,'best_solution': best_solution,'best_fitness': best_fitness})# 根据适应度值确定复制的数量并且形成繁殖池reproduction_ratios = fitness_values / np.sum(fitness_values) # 计算每个个体的适应度值占总适应度值的比例sorted_index_ratios = np.argsort(reproduction_ratios) # 对比例进行排序half_length = len(sorted_index_ratios) // 2 # 选择前一半的个体first_half_index = sorted_index_ratios[:half_length] # 选择前一半的个体的索引new_half_population = population[first_half_index] # 选择前一半的个体breeding_pool = np.concatenate((new_half_population, new_half_population)) # 将前一半的个体复制一份,形成繁殖池# 选择父母        parents_1 = breeding_pool[:half_length]parents_2 = breeding_pool[half_length:] # 先获取最后一半的父母parents_2 = np.flip(parents_2, axis=0) # 再将父母的顺序反转# 选择和交叉parents_1, parents_2 = crossover(parents_1, parents_2, crossover_rate)# 变异parents_1, parents_2 = mutate(parents_1, parents_2, mutation_rate)# 更新种群population = np.vstack([parents_1, parents_2])return best_solution, best_fitness, evolution_data# 设置算法参数
population_size = 10000
num_generations = 40
mutation_rate = 0.1  # 变异率
crossover_rate = 0.4   # 交叉率# 运行进化算法
best_solution, best_fitness, evolution_data = evolutionary_algorithm(population_size, num_generations, mutation_rate, crossover_rate)# 输出结果
print("最小值:", best_fitness)
print("最优解:", best_solution)# 输出每个迭代步骤的最佳适应度值
print("每个迭代步骤的最佳适应度值:")
for step in evolution_data:print(f"Generation {step['generation']}: {step['best_fitness']}")# 可视化函数曲面和最优解
x1_vals = np.linspace(0, 6, 100)
x2_vals = np.linspace(0, 6, 100)
X1, X2 = np.meshgrid(x1_vals, x2_vals)
Z = 3 - np.sin(2 * X1)**2 - np.sin(2 * X2)**2fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.plot_surface(X1, X2, Z, alpha=0.5, cmap='viridis')
ax.scatter(best_solution[0], best_solution[1], best_fitness, color='red', marker='o', label='Best Solution')
ax.set_xlabel('X1')
ax.set_ylabel('X2')
ax.set_zlabel('f(x)')
ax.set_title('Objective Function and Best Solution')
ax.legend()# 绘制适应度值的变化曲线
evolution_df = pd.DataFrame(evolution_data)
plt.figure()
plt.plot(evolution_df['generation'], evolution_df['best_fitness'], label='Best Fitness')
plt.xlabel('Generation')
plt.ylabel('Fitness')
plt.title('Evolution of Fitness')
plt.legend()plt.show()

4.3 Shubert 函数的最小值

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt# 定义目标函数
def objective_function(x):result = 1for i in range(1, 3):inner_sum = 0for j in range(1, 6):inner_sum += j * np.cos((j + 1) * x[i - 1] + j)result *= inner_sumreturn result # 定义选择函数
def crossover(parents_1, parents_2, crossover_rate):num_parents = len(parents_1) # 父母的数量 num_crossover = int(crossover_rate * num_parents) # 选择进行交叉的父母对的数量# 选择进行交叉的父母对crossover_indices = np.random.choice(num_parents, size=num_crossover, replace=False) # 选择进行交叉的父母对的索引# 复制父母copy_parents_1 = np.copy(parents_1)copy_parents_2 = np.copy(parents_2)# 进行交叉操作for i in crossover_indices:parents_1[i][1] = copy_parents_2[i][1] # 交叉变量x2parents_2[i][1] = copy_parents_1[i][1] # 交叉变量x2return parents_1, parents_2# 定义变异函数
def mutate(parents_1, parents_2, mutation_rate):num_parents = len(parents_1) # 父母的数量num_mutations = int(mutation_rate * num_parents) # 选择进行变异的父母对的数量# 选择进行变异的父母对mutation_indices = np.random.choice(num_parents, size=num_mutations, replace=False) # 选择进行变异的父母对的索引# 进行变异操作for i in mutation_indices:parents_1[i][1] = np.random.uniform(-10, 10)  # 变异变量x2parents_2[i][1] = np.random.uniform(-10, 10)  # 变异变量x2return parents_1, parents_2# 定义进化算法
def evolutionary_algorithm(population_size, num_generations, mutation_rate, crossover_rate):bounds = [(-10, 10), (-10, 10)]  # 变量的取值范围# 保存每个迭代步骤的信息evolution_data = []# 初始化种群population = np.random.uniform(bounds[0][0], bounds[0][1], size=(population_size, 2))# 设置初始的 best_solutionbest_solution = population[0]  # 选择种群中的第一个个体作为初始值best_fitness = objective_function(best_solution) # 计算初始值的适应度值for generation in range(num_generations):# 计算适应度fitness_values = np.apply_along_axis(objective_function, 1, population) # 找到当前最佳解current_best_index = np.argmin(fitness_values)current_best_solution = population[current_best_index]current_best_fitness = fitness_values[current_best_index]# 绘制每次迭代的三维分布图fig = plt.figure() # 创建一个新的图形ax = fig.add_subplot(111, projection='3d') # 创建一个三维的坐标系ax.scatter(population[:, 0], population[:, 1], fitness_values, color='black', marker='.', label='Population') # 绘制种群的分布图ax.scatter(current_best_solution[0], current_best_solution[1], current_best_fitness, s=100, color='red', marker='o', label='Best Solution') # 绘制最佳解的分布图# 设置坐标轴的标签ax.set_xlabel('X1') ax.set_ylabel('X2')ax.set_zlabel('f(x)')ax.set_title(f'Generation {generation} - Best Fitness: {current_best_fitness:.6f}')ax.legend() # 显示图例plt.show() # 显示图形# 更新全局最佳解if current_best_fitness < best_fitness: # 如果当前的最佳解的适应度值小于全局最佳解的适应度值best_solution = current_best_solutionbest_fitness = current_best_fitness# 保存当前迭代步骤的信息evolution_data.append({'generation': generation,'best_solution': best_solution,'best_fitness': best_fitness})# 根据适应度值确定复制的数量并且形成繁殖池reproduction_ratios = fitness_values / np.sum(fitness_values) # 计算每个个体的适应度值占总适应度值的比例sorted_index_ratios = np.argsort(reproduction_ratios) # 对比例进行排序half_length = len(sorted_index_ratios) // 2 # 选择后一半的个体first_half_index = sorted_index_ratios[half_length:] # 选择后一半的个体的索引new_half_population = population[first_half_index] # 选择后一半的个体breeding_pool = np.concatenate((new_half_population, new_half_population)) # 将后一半的个体复制一份,形成繁殖池# 选择父母        parents_1 = breeding_pool[:half_length]parents_2 = breeding_pool[half_length:] # 先获取最后一半的父母parents_2 = np.flip(parents_2, axis=0) # 再将父母的顺序反转# 选择和交叉parents_1, parents_2 = crossover(parents_1, parents_2, crossover_rate)# 变异parents_1, parents_2 = mutate(parents_1, parents_2, mutation_rate)# 更新种群population = np.vstack([parents_1, parents_2])return best_solution, best_fitness, evolution_data# 设置算法参数
population_size = 15000
num_generations = 40
mutation_rate = 0.08  # 变异率
crossover_rate = 0.2   # 交叉率# 运行进化算法
best_solution, best_fitness, evolution_data = evolutionary_algorithm(population_size, num_generations, mutation_rate, crossover_rate)# 输出结果
print("最小值:", best_fitness)
print("最优解:", best_solution)# 输出每个迭代步骤的最佳适应度值
print("每个迭代步骤的最佳适应度值:")
for step in evolution_data:print(f"Generation {step['generation']}: {step['best_fitness']}")# 可视化函数曲面和最优解
x1_vals = np.linspace(-10, 10, 100)
x2_vals = np.linspace(-10, 10, 100)
X1, X2 = np.meshgrid(x1_vals, x2_vals)
Z = np.zeros_like(X1)
for i in range(Z.shape[0]):for j in range(Z.shape[1]):Z[i, j] = objective_function([X1[i, j], X2[i, j]])fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.plot_surface(X1, X2, Z, alpha=0.5, cmap='viridis')
ax.scatter(best_solution[0], best_solution[1], best_fitness, color='red', marker='o', label='Best Solution')
ax.set_xlabel('X1')
ax.set_ylabel('X2')
ax.set_zlabel('f(x)')
ax.set_title('Objective Function and Best Solution')
ax.legend()# 绘制适应度值的变化曲线
evolution_df = pd.DataFrame(evolution_data)
plt.figure()
plt.plot(evolution_df['generation'], evolution_df['best_fitness'], label='Best Fitness')
plt.xlabel('Generation')
plt.ylabel('Fitness')
plt.title('Evolution of Fitness')
plt.legend()plt.show()

5 附录

5.1 In[1] 输出

output_0_0

output_0_1

output_0_2

output_0_3

output_0_4

output_0_5

output_0_6

output_0_7

output_0_8

output_0_9

output_0_10

output_0_11

output_0_12

output_0_13

output_0_14

output_0_15

output_0_16

output_0_17

output_0_18

output_0_19

output_0_20

output_0_21

output_0_22

output_0_23

output_0_24

output_0_25

output_0_26

output_0_27

output_0_28

output_0_29

output_0_30

output_0_31

output_0_32

output_0_33

output_0_34

output_0_35

output_0_36

output_0_37

output_0_38

output_0_39

output_0_41

最小值: 1.0000002473000187

最优解: [0.78562713 0.7854951 ]

每个迭代步骤的最佳适应度值:

Generation 0: 1.0000153042180673

Generation 1: 1.0000153042180673

Generation 2: 1.0000153042180673

Generation 3: 1.0000136942409763

Generation 4: 1.0000136942409763

Generation 5: 1.0000136942409763

Generation 6: 1.0000136942409763

Generation 7: 1.0000100419077742

Generation 8: 1.000005565304546

Generation 9: 1.000002458099502

Generation 10: 1.0000022366988228

Generation 11: 1.0000007727585987

Generation 12: 1.0000007727585987

Generation 13: 1.0000007091648468

Generation 14: 1.0000007091648468

Generation 15: 1.0000004471760704

Generation 16: 1.0000004471760704

Generation 17: 1.0000004471760704

Generation 18: 1.0000004471760704

Generation 19: 1.0000002609708571

Generation 20: 1.0000002609708571

Generation 21: 1.0000002609708571

Generation 22: 1.0000002609708571

Generation 23: 1.0000002609708571

Generation 24: 1.0000002609708571

Generation 25: 1.0000002609708571

Generation 26: 1.0000002609708571

Generation 27: 1.0000002609708571

Generation 28: 1.0000002609708571

Generation 29: 1.0000002473000187

Generation 30: 1.0000002473000187

Generation 31: 1.0000002473000187

Generation 32: 1.0000002473000187

Generation 33: 1.0000002473000187

Generation 34: 1.0000002473000187

Generation 35: 1.0000002473000187

Generation 36: 1.0000002473000187

Generation 37: 1.0000002473000187

Generation 38: 1.0000002473000187

Generation 39: 1.0000002473000187

output_0_41

output_0_42

5.2 In[2] 输出

output_1_0

output_1_1

output_1_2

output_1_3

output_1_4

output_1_5

output_1_6

output_1_7

output_1_8

output_1_9

output_1_10

output_1_11

output_1_12

output_1_13

output_1_14

output_1_15

output_1_16

output_1_17

output_1_18

output_1_19

output_1_20

output_1_21

output_1_22

output_1_23

output_1_24

output_1_25

output_1_26

output_1_27

output_1_28

output_1_29

output_1_30

output_1_31

output_1_32

output_1_33

output_1_34

output_1_35

output_1_36

output_1_37

output_1_38

output_1_39

最小值: -186.73042323192567

最优解: [-7.70876845 -7.08354764]

每个迭代步骤的最佳适应度值:

Generation 0: -186.59098010602338

Generation 1: -186.59098010602338

Generation 2: -186.59098010602338

Generation 3: -186.59098010602338

Generation 4: -186.70224634663253

Generation 5: -186.70224634663253

Generation 6: -186.70224634663253

Generation 7: -186.70224634663253

Generation 8: -186.70224634663253

Generation 9: -186.70224634663253

Generation 10: -186.70224634663253

Generation 11: -186.71507272172664

Generation 12: -186.71507272172664

Generation 13: -186.7289048406221

Generation 14: -186.73006643615773

Generation 15: -186.73006643615773

Generation 16: -186.73006643615773

Generation 17: -186.73006643615773

Generation 18: -186.73009038074477

Generation 19: -186.73009038074477

Generation 20: -186.73009038074477

Generation 21: -186.73009038074477

Generation 22: -186.73009038074477

Generation 23: -186.73042323192567

Generation 24: -186.73042323192567

Generation 25: -186.73042323192567

Generation 26: -186.73042323192567

Generation 27: -186.73042323192567

Generation 28: -186.73042323192567

Generation 29: -186.73042323192567

Generation 30: -186.73042323192567

Generation 31: -186.73042323192567

Generation 32: -186.73042323192567

Generation 33: -186.73042323192567

Generation 34: -186.73042323192567

Generation 35: -186.73042323192567

Generation 36: -186.73042323192567

Generation 37: -186.73042323192567

Generation 38: -186.73042323192567

Generation 39: -186.73042323192567

output_1_41

output_1_42

这篇关于【Python】人工智能-机器学习——不调库手撕演化算法解决函数最小值问题的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/625252

相关文章

Python中conda虚拟环境创建及使用小结

《Python中conda虚拟环境创建及使用小结》本文主要介绍了Python中conda虚拟环境创建及使用小结,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们... 目录0.前言1.Miniconda安装2.conda本地基本操作3.创建conda虚拟环境4.激活c

golang panic 函数用法示例详解

《golangpanic函数用法示例详解》在Go语言中,panic用于触发不可恢复的错误,终止函数执行并逐层向上触发defer,最终若未被recover捕获,程序会崩溃,recover用于在def... 目录1. panic 的作用2. 基本用法3. recover 的使用规则4. 错误处理建议5. 常见错

在 Spring Boot 中使用异步线程时的 HttpServletRequest 复用问题记录

《在SpringBoot中使用异步线程时的HttpServletRequest复用问题记录》文章讨论了在SpringBoot中使用异步线程时,由于HttpServletRequest复用导致... 目录一、问题描述:异步线程操作导致请求复用时 Cookie 解析失败1. 场景背景2. 问题根源二、问题详细分

解读为什么@Autowired在属性上被警告,在setter方法上不被警告问题

《解读为什么@Autowired在属性上被警告,在setter方法上不被警告问题》在Spring开发中,@Autowired注解常用于实现依赖注入,它可以应用于类的属性、构造器或setter方法上,然... 目录1. 为什么 @Autowired 在属性上被警告?1.1 隐式依赖注入1.2 IDE 的警告:

使用Python创建一个能够筛选文件的PDF合并工具

《使用Python创建一个能够筛选文件的PDF合并工具》这篇文章主要为大家详细介绍了如何使用Python创建一个能够筛选文件的PDF合并工具,文中的示例代码讲解详细,感兴趣的小伙伴可以了解下... 目录背景主要功能全部代码代码解析1. 初始化 wx.Frame 窗口2. 创建工具栏3. 创建布局和界面控件4

一文详解如何在Python中使用Requests库

《一文详解如何在Python中使用Requests库》:本文主要介绍如何在Python中使用Requests库的相关资料,Requests库是Python中常用的第三方库,用于简化HTTP请求的发... 目录前言1. 安装Requests库2. 发起GET请求3. 发送带有查询参数的GET请求4. 发起PO

Python与DeepSeek的深度融合实战

《Python与DeepSeek的深度融合实战》Python作为最受欢迎的编程语言之一,以其简洁易读的语法、丰富的库和广泛的应用场景,成为了无数开发者的首选,而DeepSeek,作为人工智能领域的新星... 目录一、python与DeepSeek的结合优势二、模型训练1. 数据准备2. 模型架构与参数设置3

Python进行PDF文件拆分的示例详解

《Python进行PDF文件拆分的示例详解》在日常生活中,我们常常会遇到大型的PDF文件,难以发送,将PDF拆分成多个小文件是一个实用的解决方案,下面我们就来看看如何使用Python实现PDF文件拆分... 目录使用工具将PDF按页数拆分将PDF的每一页拆分为单独的文件将PDF按指定页数拆分根据页码范围拆分

解决java.lang.NullPointerException问题(空指针异常)

《解决java.lang.NullPointerException问题(空指针异常)》本文详细介绍了Java中的NullPointerException异常及其常见原因,包括对象引用为null、数组元... 目录Java.lang.NullPointerException(空指针异常)NullPointer

Android开发中gradle下载缓慢的问题级解决方法

《Android开发中gradle下载缓慢的问题级解决方法》本文介绍了解决Android开发中Gradle下载缓慢问题的几种方法,本文给大家介绍的非常详细,感兴趣的朋友跟随小编一起看看吧... 目录一、网络环境优化二、Gradle版本与配置优化三、其他优化措施针对android开发中Gradle下载缓慢的问