ieee进化计算大会(cec'2005)实际优化会议基准包
cec2005real的Python项目详细描述
这是一个Python包装,使用C++实现了在2005届IEEE大会上关于进化计算的大规模全局优化的特殊会话。
注
如果要使用此代码的任何部分,请引用以下出版物:
- Suganthan,N.Hansen,J.J.Liang,K.Deb,Y.-P.Chen,A.Auger和S.Tiwari,“CEC 2005年实际参数优化特别会议的问题定义和评估标准”,技术报告,新加坡南洋理工大学,2005年5月和Kangal报告,2005年5月,印度坎普尔IIT。
http://www3.ntu.edu.sg/home/EPNSugan/index_files/CEC-05/CEC05.htm
要求
- GNU制造
- GNU G++
- Python
- 赛顿
测试环境
- debian gnu/linux杰西/sid
- GNU制造3.81
- G++(Debian 4.7.3-4)4.7.3
- Python2.7和Python3.2
- 纽比1.8.1
- cython 0.20.1
travis ci
安装
非常简单,pip安装cec2005real;-)。
您还可以从https://github.com/dmolina/cec2005real下载并执行python setup.py install[-user]。 (选项–user用于作为普通用户在本地安装包(如果您想 在没有管理权限的群集/服务器中运行实验)。
C++中的源代码也是可用的。如果你只想编译C++ 在源代码的根目录中的“make”中键入版本。
有两个等价的演示可执行文件:demo和demo2。
^ {STR 1 } $记住:为了运行C++版本,目录CDATAFILE必须在工作目录中可用。 在python版本中,这些文件包含在包中,因此不需要。
测试
源代码有测试来检查关于每个函数的信息,以及获得的结果 使用C语言版本的解np.zeros(10)(一个零的解)。
快速启动
这个包使用起来很简单。有一个类函数有两个函数:
- 给出每个函数的信息:它们的最优值、维数、域搜索和 期望阈值达到最优。
- 给出一个适合度函数来评估解决方案。它期望这些解决方案是numpy阵列 (矢量)但它也可以用于普通数组。
这两个功能是用基准类中的两个方法实现的:
get_num_functions()
返回基准中的函数数(15)
get_info()
返回包含以下信息的数组,其中/function_id/是函数的标识符,一个介于1和15之间的int值。
- lower, upper
- lower and upper boundaries of the domain search.
- best
- Optimum to achieve, it is always zero, thus it can be ignored.
- threshold
- Threshold to obtain, it is always zero, thus it can also be ignored.
- dimension
- Dimension for the function, it is always 1000.
It can be noticed that several data are the same for all functions. It is made for maintaining the same interface to other cec20xx competitions.
get_eval_function()
它返回适应度函数来评估解。
使用示例
获取有关一个函数的信息
>>> from cec2005real.cec2005 import Function >>> fbench = Function(1, 10) >>> fbench.get_info() {'best': 0.0, 'dimension': 1000, 'lower': -100.0, 'threshold': 0, 'upper': 100.0}
为搜索创建随机解决方案
>>> from numpy.random import rand >>> info = fbench.get_info() >>> dim = info['dimension'] >>> sol = info['lower']+rand(dim)*(info['upper']-info['lower'])
评估溶液
>>> fun_fitness = fbench.get_eval_function() >>> fun_fitness(sol) 464006824710.75995
联系人
- python包
- 丹尼尔·莫利纳@加的斯大学计算机科学系 如有任何疑问或建议,请随时致电<;daniel.molina@uca.es>;与我联系。
上次更新时间:
- python包装 <;2015-10-30>;