コード例 #1
0
ファイル: rna.cpp プロジェクト: SkylarKelty/CodonSim
/**
 * Process the chain, with a given chance of processing individual codons
 * This goes through every codon, and has a chance of "synswch" it meaning
 * the codon will choose either itself or another, synonymous codon, instead
 */
void RNA::process(int chance, PopulationNode *pop) {
	chance = chance % 100;

	m_time += get_time();
	m_product++;
	RNA::t_product++;

	if (m_product >= 3 && m_product % 3 == 0) {
		// After 3 products, mutate self and add to pop
		RNA *n = clone();
		n->synswch(chance);
		pop->add_RNA(n);
	}
}