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:
parent
fb74671204
commit
28210e39d5
1 changed files with 6 additions and 2 deletions
|
|
@ -216,8 +216,12 @@ void GeneTriangle::draw(sf::RenderTarget& target, sf::RenderStates states) const
|
||||||
void GeneTriangle::randomize()
|
void GeneTriangle::randomize()
|
||||||
{
|
{
|
||||||
Gene::randomizePosition(this->pos1);
|
Gene::randomizePosition(this->pos1);
|
||||||
Gene::randomizePosition(this->pos2);
|
// Gene::randomizePosition(this->pos2);
|
||||||
Gene::randomizePosition(this->pos3);
|
// 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);
|
Gene::randomizeColor(this->color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue