CodingTrain / CodingTrain/Suggestion-Box
Evolution time
- 主要言語
- 言語のデータがありません
- スター
- 570
- フォーク
- 85
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
I have an idea of decreasing evolution time by shifting gene index for fitness calculation.
Suppose we want to generate "To be or not to be". We compare every single letter to the result every time we want to calculate fitness. Code below increases comparing gene index starting point by 1 every 10th generation is made. Every time fitness calculation is active, comparing gene index will increase by 3.
The question arises. How can we be sure that every 3rd gene with starting point of 1 and 2 is "correct" after 20 generations? Maybe new way of reproduction or just adding an inspection array in fitness calculation method?
public class Evolution {
private final int TIME_INTERVAL = 10;
private final int GENE_SHIFT = 3;
private int geneStart = 0;
public Evolution(DNA resultDNA) {
startEvolution(resultDNA);
}
public void startEvolution(DNA resultDNA) {
initializePopulation();
int counter = 0;
while(true) {
counter++;
if(counter > TIME_INTERVAL) {
geneStart++;
if(geneStart > GENE_SHIFT - 1) {
geneStart = 0;
}
counter = 0;
}
calculateFitness(resultDNA.getGenes());
doSelection();
doReproduction();
if(evaluationOK()) {
break;
}
}
}
private void calculateFitness(Gene[] resultGenes) {
for(DNA dna : population) {
Gene[] genes = dna.getGenes();
dna.setFitness(0);
int i = geneStart;
while(i < genes.length) {
if(genes[i] == resultGenes[i]) {
dna.increaseFitness();
}
i += GENE_SHIFT;
}
}
}
private void doSelection() {
//...
}
private void doReproduction() {
//...
}
}
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
No repository file, test, or entry point is named. Start by locating any existing evolution or fitness-calculation implementation related to this proposal, then review whether the gene-shifting approach preserves fitness coverage across generations. Done is not defined by the issue; a contributor would need an agreed algorithm and validation criteria first.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- machine-learning
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 20/100