资源简介
蚁狮算法(Ant Lion Algorithm)原创者论文
及相应的Python实现和matlab实现
及相应的Python实现和matlab实现

代码片段和文件信息
# coding:utf-8
“““
作者:zhaoxingfeng 日期:2016.12.02
功能:蚁狮优化算法,Ant Lion Optimizer(ALO)
版本:2.0
参考文献:
[1]Seyedali Mirjalili.The Ant Lion Optimizer[J].ADVANCES IN ENGINEERING SOFTWARE 2015 83 80-98.
[2]Verma S. Mukherjee V.Optimal real power rescheduling of generators for congestion management
using a novel ant lion optimiser[J].ENGINEERING ELECTRICAL & ELECTRONIC201672548-2561.
[3]崔东文 王宗斌. 基于ALO-ENN算法的洪灾评估模型及应[J].人民珠江 2016 37(5): 44-50.
说明:
2015年被人提出来的一种仿生优化算法,Ant Lion Optimizer即蚁狮优化算法,具有全局优化、调节参数少、收敛精度高、鲁棒性
好的优点,已被应用到SVM、Elman神经网络、GM(11)以及螺旋桨页面曲线参数寻优等场合。
“““
from __future__ import division
import numpy as np
import random
import matplotlib as mpl
import matplotlib.pyplot as plt
import time
class ALO(object):
def __init__(self N Max_iter lb ub dim Fobj):
“““
N:蚂蚁和蚁狮规模,蚂蚁和蚁狮数量相等
Max_iter:最大迭代次数
lb ub :搜索范围 -> 变量取值范围
dim:解的维度
Fobj:价值函数
“““
self.N = N
self.Max_iter = Max_iter
self.lb = np.array(lb)
self.ub = np.array(ub)
self.dim = dim
self.Fobj = Fobj
# 初始化 ant 和 antlion 位置
def Initialization(self):
x = [[0 for col in range(self.dim)] for row in range(self.N)]
for i in range(self.N):
for j in range(self.dim):
x[i][j] = random.random() * (self.ub[j]-self.lb[j]) + self.lb[j]
return x
# 轮盘赌
def RouletteWheelSelection(self weights):
accumulation = [0 for col in range(self.N)]
for i in range(self.N):
accumulation[-1] = 0
accumulation[i] += accumulation[i-1] + weights[i]
p = random.random() * accumulation[-1]
for j in range(self.N):
if accumulation[j] > p:
index = j
break
return index
# 随机游走
def Random_walk_around_antlion(self antlion current_iter):
if current_iter >= self.Max_iter * 0.95:
I = 1 + 10**6 * (current_iter/self.Max_iter)
elif current_iter >= self.Max_iter * 0.9:
I = 1 + 10**5 * (current_iter/self.Max_iter)
elif current_iter >= self.Max_iter * 3/4:
I = 1 + 10**4 * (current_iter/self.Max_iter)
elif current_iter >= self.Max_iter * 0.5:
I = 1 + 10**3 * (current_iter/self.Max_iter)
else:
I = 1 + 10**2 * (current_iter/self.Max_iter)
# 公式 (2.10)、(2.11)
lb ub = self.lb/I self.ub/I
# 公式 (2.8)
if random.random() < 0.5:
lb = lb + antlion
else:
lb = -lb + antlion
# 公式 (2.9)
if random.random() >= 0.5:
ub = ub + antlion
else:
ub = -ub + antlion
# create n random walks and normalize accroding to lb and ub
RWs = [[0 for col in range(self.dim)] for row in range(self.Max_iter + 1)]
for dim in range(self.dim):
# 公式 (2.2
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-12-21 17:09 蚁狮算法\
文件 2977466 2019-12-20 22:17 蚁狮算法\ALO.pdf
文件 8962 2019-12-20 21:29 蚁狮算法\ALO.py
目录 0 2019-12-21 17:09 蚁狮算法\matlab\
文件 5844 2015-02-20 12:06 蚁狮算法\matlab\ALO.m
文件 150992 2015-03-04 06:56 蚁狮算法\matlab\ALO.png
文件 3597 2015-02-20 13:21 蚁狮算法\matlab\func_plot.m
文件 7708 2015-02-20 12:07 蚁狮算法\matlab\Get_Functions_details.m
文件 1881 2015-02-20 13:17 蚁狮算法\matlab\initialization.m
文件 3105 2015-02-20 12:52 蚁狮算法\matlab\main.m
文件 2932 2015-02-20 17:11 蚁狮算法\matlab\Random_walk_around_antlion.m
文件 2199 2015-02-20 13:21 蚁狮算法\matlab\RouletteWheelSelection.m
相关资源
- Instant Pygame for Python Game Development How
- Biopython Tutorial
- Think Python 2nd
- 一个小小的表白程序(python)
- Python课堂笔记(高淇400集第一季)
- 二级考试python试题12套(包括选择题和
- pywin32_python3.6_64位
- python+ selenium教程
- PycURL(Windows7/Win32)Python2.7安装包 P
- 英文原版-Scientific Computing with Python
- 7.图像风格迁移 基于深度学习 pyt
- 基于Python的学生管理系统
- A Byte of Python(简明Python教程)(第
- Python实例174946
- Python 人脸识别
- Python 人事管理系统
- 基于python-flask的个人博客系统
- 计算机视觉应用开发流程
- python 调用sftp断点续传文件
- python socket游戏
- 基于Python爬虫爬取天气预报信息
- python函数编程和讲解
- Python开发的个人博客
- 基于python的三层神经网络模型搭建
- python实现自动操作windows应用
- python人脸识别(opencv)
- python 绘图(方形、线条、圆形)
- python疫情卡UN管控
- python 连连看小游戏源码
- 基于PyQt5的视频播放器设计
评论
共有 条评论