>// Genetic.cpp: implementation of the CGenetic class.
>#include "stdafx.h"</P>
>#include "Genetic.h"
>CGenetic::CGenetic()5 W9 N, Q, y2 g" x6 u5 Y5 |: d
>CGenetic::~CGenetic()
>int CGenetic::rselect()# z. q2 d. P- V. f1 W; i! e
OPSIZE));$ A7 _* `7 ?; v- x. d. b
>void CGenetic::generation()( E h7 \( D/ @3 X7 b l" g
OPSIZE;i+=2){2 {1 y* [0 V/ i3 D# A3 V+ }" E
> // oldpop,newpop进行调换
OPSIZE;i++){
OPSIZE;i++)/ R% c. z# {& Y8 M) d
>bool CGenetic::begin()! Y7 K1 C! y2 [/ M, }% d( K; L
eekMessage(&msg,NULL,0,0,PM_REMOVE);
ispatchMessage(&msg);+ ^4 A# C+ q* Z
ispatchMessage(&msg);//这样可以消除屏闪
>return(true);
>. V3 `" [7 F6 x5 R8 y5 f
>}</P>4 Z8 S4 ^# Z+ M' }# h
>bool CGenetic::flip(double possibility)( ^2 n1 t: F9 _* w; K) z3 q; d
>void CGenetic::mutation(CHROM *chrome)
>void CGenetic::statistic(CHROM pop[])
OPSIZE;i++){& c3 o1 Q! p7 n* ^1 e+ b# e
OPSIZE;i++){. p$ I! e1 N, Q
>}</P>
>void CGenetic::init()
>if(iVarNo!=0&&IsSetScope)7 ~, ?/ ]* z, q. J n q/ q0 O
OPSIZE;i++){
>double CGenetic::randxy(double x, double y)+ p+ U( k$ K# H7 D) B2 b
>}</P>
>void CGenetic::setscope(double scope[MAXVARNO][2], int iNo)2 |6 t& x1 D" q; v; W; n1 O+ R
>}</P>* j2 M/ k1 d1 l9 t( |
>double CGenetic::CalFitness(CHROM chrome)
>能不能发份你的这部分程序给我啊?(包含Genetic.h头文件)</P><
>谢谢!</P><
><a href="mailthawkltl@eyou.com" target="_blank" >hawkltl@eyou.com</A></P><
>QQ:297478832</P>
>有量子遗传算法解背包问题的程序么,谢谢斑竹</P>2 b) a9 M$ E! K8 T; S' D
>QQ 20409589 EMAIL yiping8241@sohu.com</P>
>好啊啊</P>
>谢谢</P>
>good</P>
>还不会用</P>
>支持</P>

| 欢迎光临 数学建模社区-数学中国 (http://www.madio.net/) | Powered by Discuz! X2.5 |