遗传算法程序模拟代码

时间:2012-11-22 07:15:24
【文件属性】:
文件名称:遗传算法程序模拟代码
文件大小:29KB
文件格式:JAVA
更新时间:2012-11-22 07:15:24
java 遗传算法 protected int N=999;//种群大小 protected int x[]=new int[N] ;//父代x表现型 protected int y[]=new int[N];//父代y表现型 protected int code_x[][]=new int[N][8];//父代x基因型 protected int code_y[][]=new int[N][8];//父代y基因型 protected double suff[]=new double[N];//个体适应度 protected double ave_suff[]=new double[N];//物种平均适应度 protected double select[]=new double[N];//选择概率 protected double odds[]=new double[N];//积累概率 protected int sele_x[][]=new int[N][8];//遗传x protected int sele_y[][]=new int[N][8];//遗传y protected int loca_x[]=new int[N];//x杂交位 protected int loca_y[]=new int[N];//y杂交位 protected int child_x[][]=new int[N][8];//杂交变异后x子代基因型 protected int child_y[][]=new int[N][8];//杂交变异后y子代基因型 protected int pro_x[]=new int[N];//x子代表现型 protected int pro_y[]=new int[N];//y子代表现型 protected int valu[]=new int[N];//子代函数值 protected int rate=1;//变异位数 protected int temp=0,flag=0,place,sum=0;//中间变量 protected double sum_suff=0.0,r;//中间变量

网友评论

  • 虽然长但是可以运行 写的很吊
  • 蛮长的Java程序