【发布时间】:2015-05-20 09:15:31
【问题描述】:
我正在开展一个项目,我正在尝试实施由 Karl Sims 撰写的“不断进化的虚拟生物”理念。
问题在于,在我读过的每个教程中,他们都是从整数或布尔值构建个体,如下所示:
pop.subpop.0.species = ec.vector.BitVectorSpecies
pop.subpop.0.species.ind = ec.vector.BitVectorIndividual
但是如果我有一个名为“Node”的类,它比这些更复杂吗?没有这样的 ec.vector.BitVectorNode。 在 ECJ 教程页面 (http://cs.gmu.edu/~eclab/projects/ecj/docs/) 中,有一个名为“教程后讨论”的教程,其中写了以下内容:
任意表示 使用 ECJ 进行任意表示相当容易。只需将个人子类化并添加您自己的表示。您可能需要制作自己的 BreedingPipelines,它知道如何跨越或改变您的表示。
我的类节点扩展了个人,但我不知道如何继续或我必须对公共代码应用哪些更改才能创建群体(例如教程 1 和 2 中的代码)
这是它的属性声明:
public class Node extends Individual
{
/** Properties */
private static final long serialVersionUID = -4771047292470201612L;
private double length;
private double width;
private double height;
private int recLimit;
private Joint joint;
private Set<Sensor> setSensors = new HashSet<Sensor>();
private Set<Neuron> setNeurons = new HashSet<Neuron>();
private Set<Effector> setEffectors = new HashSet<Effector>();
private Set<Connection> setConnections = new HashSet<Connection>();
//And then the methods
任何帮助将不胜感激。
【问题讨论】:
标签: java genetic-algorithm genetic-programming