- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
免疫算法c代码(Immune algorithm C code)
免疫算法c代码(Immune algorithm C code)
# includes stdio.h
# includes stdlib.h
# includes time.h
# includes math.h
# define length1 10
# define length2 10
# define chromlength length1 + length2
# define popsize 300
int maxgeneration = 200;
struct individual
{
char chrom [chromlength + 1].
double value; / / 适应度
double affective; / / 亲和力
double concentration; / / 浓度
double activity; / / 激励度
};
int generation;
int best _ index;
struct individual population [popsize];
struct individual nextpopulation [popsize];
struct individual array [popsize];
struct individual;
struct individual b;
struct individual bestindividual;
struct individual currentbest;
int popsize = 80; / / 全局变量
double umu = 0.08; / / 全局变量
double r = 0.001; / / 全局变量
double rad = 0.3.
int clone _ total = 0; / / 全局变量
/ / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * the * * * * * * * * * * * *
void generateinitialpopulation ();
long decodechromosome (char * string, int pointer, int length)
void calculateobjectvalue (struct individual array [], int n)
void calculateaffective (struct individual array [], int n)
void evaluatepopulation ();
void affectivesort (struct individual array [], int n)
void clonenum ();
mutationoperator (void); void
generatenextpopulation (void); void
double calculatesimilarity (struct individual, struct individual (b);
inhibition (void); void
void chongzu ();
void calculateconcentrationvalue (struct individual population [], int n)
void calculateactivityvalue (struct individual population [], int n)
void activeslect ();
void sortnewmember ();
void performevolution ();
void findbestindividual ();
void outputtextreport ();
/ / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * the * * * * * * * * * * * * *
void main ()
{
generation = 0;
generateinitialpopulation ();
evaluatepopulation ();
while (generation - maxgeneration)
{
generation + +
您可能关注的文档
- 为什么地球上的生物都是由细胞组成的(Why are all living things on the earth made up of cells).doc
- 中药药剂学模拟试卷(Traditional Chinese medicine pharmaceutics simulation test paper).doc
- 为什么李阳注定要失败(Why is Li Yang doomed to fail).doc
- 为什么要讨论白皮书(Why do you want to discuss white papers).doc
- 为什么唐峻们的年薪上亿元(1月9日)(Why don't Tang Jun earn an annual salary of one hundred million yuan (January 9th)).doc
- 为圆母亲心愿 疯狂孝子推母亲3个月步行3千公里(Round mother wishes crazy filial mother for 3 months to push the 3 thousand km walk).doc
- 为牛奶找一个搭档--华美新产品策划案(Looking for a partner for milk -- Huamei new product planning case).doc
- 主板维修讲义(Motherboard maintenance handouts).doc
- 主板维修资料(Motherboard maintenance data).doc
- 为和平而战斗 【美国】杜波依斯(1868—1963)(Fighting for peace [USA] Dubois (1868 - 1963)).doc
- 免费增值先搭台再唱戏(Freemium first set up the stage again singing).doc
- 免费计算机技术文档下载-网页制作规范(Free computer technology documentation download - Web authoring specifications).doc
- 兔小灰&兔小白(Rabbit Grey & Rabbit white).doc
- 兔小白和兔小灰(Rabbit white rabbit and rabbit small grey).doc
- 党史知识测试(Knowledge test of Party History).doc
- 免费dos命令字典(Free DOS command dictionary).doc
- 党员干部要做宣传的播种机(Party members and cadres should make propaganda seeding machine).doc
- 党员电教片时代气息思考(Party member, audio-visual education, times, reflection).doc
- 党支部抓党 建工作责任制度(Party branch, Party construction, responsibility system).doc
- 党政领导干部公开选拔和竞争上岗考试资源网11(Party and government leading cadres open selection and competition examination Resources Network 11).doc
原创力文档


文档评论(0)