摘要
遗传算法中,基因型串结构数据表示为无符号二进制整数,但在传统程序设计中,数据中的“0”和“1”是以字符(char)形式存储的,这样表示的基因数据不仅在数据结构上和实际存在差异,多占用了内存空间,而且也使算法中的操作实际是字符串操作。利用C++面向对象设计思想,通过引入二进制位集合类,使基因型数据真正表示为二进制位(bit)数据,并改进了数据的存储方式,减少了内存需求,使遗传操作编程更方便。
In the genetic algorithm,gene data is presented as unsigned binary integers.But'0'and '1' in this data are saved as chars in the traditional programming.As a result,the genetic data not only differ from the real storage form in data structure and occupy extra memory,but also make the operation of algorithm as char string operation.This paper presents a binary bit set class programmed in C++ with OOP,which expresses the genetic data in the form of bnary bits,improves data storage form and decreases its demand for memory,making the programming of genetic operation more convenient.
出处
《电脑开发与应用》
2005年第8期36-37,共2页
Computer Development & Applications
关键词
遗传算法
二进制
集合类
应用
genetic algorithm,binary,set class,application