1
edit
Changes
→RSA Key Generator
carry = 0;
}
}
}
</pre></big>
=== <u>Mutation Simulator</u> ===
Attempted by: Zack Bloom
This is a project I had made on my own. It is a simple mutation simulator.
This type of project gets used in genetic algorithms, and can be considered a primitive engine of one.
The goal of a genetic algorithm is to find an observable optimum solution within a population by breeding over many generations.
The main difference between my Mutation Simulator and a genetic algorithm, is that my mutation simulator lacks a metric to judge the fitness of each offspring within a population.
The general idea of how this works is with this diagram (minor differences can be found within my program)
[[Image:GA.png]]
These are the two methods I was planning to parallelize
<big><pre>
void Offspring::mutate(float mutationChance)
{
for (int i = 0; i < amountOfGenes; i++){
geneticMakeup[i].mutate(mutationChance);
}
}
</pre></big>
OR
<big><pre>
void Population::breed(int index, float mutationChance)
{
int aOrB;
for (int i = 0; i < organisms[index]->amountOfGenes; i++)
{
aOrB = rand() % 2;
if (aOrB == 0)//
organisms[index+1]->geneticMakeup[i] = organisms[index]->geneticMakeup[i];
else //
organisms[index]->geneticMakeup[i] = organisms[index+1]->geneticMakeup[i];
organisms[index]->mutate(mutationChance);
organisms[index+1]->mutate(mutationChance);
}
}
</pre></big>