|
|||||||||
上一个类 下一个类 | 框架 无框架 | ||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
java.lang.Objectga4robot.Chromosome
public class Chromosome
染色体
构造方法摘要 | |
---|---|
Chromosome(int n)
染色体构造函数 |
方法摘要 | |
---|---|
void |
addGene(int id,
Gene gene)
在 id 位上添加基因 gene |
Chromosome |
clone()
重载 clone 方法 |
java.util.ArrayList<Chromosome> |
crossover(Chromosome chromosome)
交叉 |
double |
evaluation()
评估函数 |
Gene |
getGene(int id)
获取 id 位的基因 |
void |
mutation()
变异 |
void |
setGene(int id,
Gene gene)
在 id 位上设置基因 gene |
从类 java.lang.Object 继承的方法 |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
构造方法详细信息 |
---|
public Chromosome(int n)
n
- 基因位数目方法详细信息 |
---|
public void setGene(int id, Gene gene)
id
- 基因位gene
- 基因public void addGene(int id, Gene gene)
id
- 基因位gene
- 基因public Gene getGene(int id)
id
- 基因位
public Chromosome clone()
java.lang.Object
中的 clone
public java.util.ArrayList<Chromosome> crossover(Chromosome chromosome)
chromosome
- 与当前染色体交叉的令一染色体
public void mutation()
public double evaluation()
|
|||||||||
上一个类 下一个类 | 框架 无框架 | ||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |