Generate smaller triangle genes

Instead of choosing three random positions for the corners, now
the positions of the second and third corner are mutations of the
first corner's position.
This commit is contained in:
Joscha 2017-05-21 00:02:29 +00:00
parent fb74671204
commit 28210e39d5

View file

@ -216,8 +216,12 @@ void GeneTriangle::draw(sf::RenderTarget& target, sf::RenderStates states) const
void GeneTriangle::randomize()
{
Gene::randomizePosition(this->pos1);
Gene::randomizePosition(this->pos2);
Gene::randomizePosition(this->pos3);
// Gene::randomizePosition(this->pos2);
// Gene::randomizePosition(this->pos3);
this->pos2 = pos1;
this->pos3 = pos1;
Gene::mutatePosition(this->pos2, GeneTriangle::stddev_position);
Gene::mutatePosition(this->pos3, GeneTriangle::stddev_position);
Gene::randomizeColor(this->color);
}